MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / stream_close

Function stream_close

fftools/ffplay.c:1310–1344  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1308}
1309
1310static void stream_close(VideoState *is)
1311{
1312 /* XXX: use a special url_shutdown call to abort parse cleanly */
1313 is->abort_request = 1;
1314 SDL_WaitThread(is->read_tid, NULL);
1315
1316 /* close each stream */
1317 if (is->audio_stream >= 0)
1318 stream_component_close(is, is->audio_stream);
1319 if (is->video_stream >= 0)
1320 stream_component_close(is, is->video_stream);
1321 if (is->subtitle_stream >= 0)
1322 stream_component_close(is, is->subtitle_stream);
1323
1324 avformat_close_input(&is->ic);
1325
1326 packet_queue_destroy(&is->videoq);
1327 packet_queue_destroy(&is->audioq);
1328 packet_queue_destroy(&is->subtitleq);
1329
1330 /* free all pictures */
1331 frame_queue_destroy(&is->pictq);
1332 frame_queue_destroy(&is->sampq);
1333 frame_queue_destroy(&is->subpq);
1334 SDL_DestroyCond(is->continue_read_thread);
1335 sws_freeContext(is->sub_convert_ctx);
1336 av_free(is->filename);
1337 if (is->vis_texture)
1338 SDL_DestroyTexture(is->vis_texture);
1339 if (is->vid_texture)
1340 SDL_DestroyTexture(is->vid_texture);
1341 if (is->sub_texture)
1342 SDL_DestroyTexture(is->sub_texture);
1343 av_free(is);
1344}
1345
1346static void do_exit(VideoState *is)
1347{

Callers 2

do_exitFunction · 0.85
stream_openFunction · 0.85

Calls 6

stream_component_closeFunction · 0.85
avformat_close_inputFunction · 0.85
packet_queue_destroyFunction · 0.85
frame_queue_destroyFunction · 0.85
sws_freeContextFunction · 0.85
av_freeFunction · 0.50

Tested by

no test coverage detected