|
|
@@ -90,19 +90,10 @@ static int player_deinit(player_stat_t *is)
|
|
|
return -1;
|
|
|
}
|
|
|
|
|
|
- is->abort_request = 1;
|
|
|
+ is->abort_request = 1;
|
|
|
|
|
|
SDL_WaitThread(is->read_tid, NULL);
|
|
|
- is->rvc_hostapi->Debug(MEDIA_LOG_DEBUG, "is->read_tid finished.");
|
|
|
- /* close each stream */
|
|
|
- //if (is->audio_idx >= 0)
|
|
|
- //{
|
|
|
- //stream_component_close(is, is->p_audio_stream);
|
|
|
- //}
|
|
|
- //if (is->video_idx >= 0)
|
|
|
- //{
|
|
|
- //stream_component_close(is, is->p_video_stream);
|
|
|
- //}
|
|
|
+ is->rvc_hostapi->Debug(MEDIA_LOG_DEBUG, "demux thread finished.");
|
|
|
|
|
|
for (int index = 0; index < is->uFilesCount; index++){
|
|
|
if (NULL != is->p_fmt_ctx[index]){
|
|
|
@@ -110,21 +101,18 @@ static int player_deinit(player_stat_t *is)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- packet_queue_abort(&is->video_pkt_queue, is->rvc_hostapi);
|
|
|
- packet_queue_abort(&is->audio_pkt_queue, is->rvc_hostapi);
|
|
|
+ //packet_queue_abort(&is->video_pkt_queue, is->rvc_hostapi);
|
|
|
+ //packet_queue_abort(&is->audio_pkt_queue, is->rvc_hostapi);
|
|
|
|
|
|
- packet_queue_destroy(&is->video_pkt_queue, is->rvc_hostapi);
|
|
|
- packet_queue_destroy(&is->audio_pkt_queue, is->rvc_hostapi);
|
|
|
+ //packet_queue_destroy(&is->video_pkt_queue, is->rvc_hostapi);
|
|
|
+ //packet_queue_destroy(&is->audio_pkt_queue, is->rvc_hostapi);
|
|
|
|
|
|
frame_queue_signal(&is->video_frm_queue);
|
|
|
frame_queue_signal(&is->audio_frm_queue);
|
|
|
|
|
|
- is->rvc_hostapi->Debug(MEDIA_LOG_DEBUG, "before frame_queue_destory.");
|
|
|
/* free all pictures */
|
|
|
- frame_queue_destory(&is->video_frm_queue);
|
|
|
- is->rvc_hostapi->Debug(MEDIA_LOG_DEBUG, "after video_frm_queue frame_queue_destory.");
|
|
|
- frame_queue_destory(&is->audio_frm_queue);
|
|
|
- is->rvc_hostapi->Debug(MEDIA_LOG_DEBUG, "after frame_queue_destory.");
|
|
|
+ //frame_queue_destory(&is->video_frm_queue);
|
|
|
+ //frame_queue_destory(&is->audio_frm_queue);
|
|
|
|
|
|
SDL_DestroyCond(is->continue_read_thread);
|
|
|
|
|
|
@@ -138,14 +126,12 @@ static int player_deinit(player_stat_t *is)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- is->rvc_hostapi->Debug(MEDIA_LOG_DEBUG, "av_free player_stat_t.");
|
|
|
- av_free(is->piconpath);
|
|
|
+ if (is->sdl_video.texture) {
|
|
|
+ SDL_DestroyTexture(is->sdl_video.texture);
|
|
|
+ }
|
|
|
|
|
|
- if (NULL != is->sdl_video.texture){
|
|
|
- //SDL_DestroyTexture(is->sdl_video.texture);
|
|
|
- }
|
|
|
is->rvc_hostapi->Debug(MEDIA_LOG_DEBUG, "av_free player_stat_t.");
|
|
|
- av_free(is);
|
|
|
+ //av_free(is);
|
|
|
|
|
|
return 0;
|
|
|
}
|
|
|
@@ -222,7 +208,7 @@ CMediaPlayer::~CMediaPlayer()
|
|
|
|
|
|
Uint32 uRet = SDL_WasInit(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_TIMER);
|
|
|
if (0 != uRet) {
|
|
|
- SDL_Quit();
|
|
|
+ //SDL_Quit();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -390,7 +376,7 @@ int CMediaPlayer::Init(rvc_media_player_param_t* pMedia_Player)
|
|
|
}
|
|
|
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
iRet = 0;
|
|
|
|
|
|
return iRet;
|
|
|
@@ -500,7 +486,7 @@ int CMediaPlayer::ExitMediaPlayingThread()
|
|
|
m_player_stat = NULL;
|
|
|
m_bplaying = false;
|
|
|
|
|
|
- avformat_network_deinit();
|
|
|
+ //avformat_network_deinit();
|
|
|
|
|
|
//SDL_Quit();
|
|
|
|