diff options
author | Marton Balint <cus@passwd.hu> | 2015-10-07 01:21:40 +0200 |
---|---|---|
committer | Marton Balint <cus@passwd.hu> | 2015-10-12 00:07:38 +0200 |
commit | 148418a2bce3a7862f2d00ed4a424620c0d51e18 (patch) | |
tree | a5e639657ffb3c518864b1618f2f43ec902ef06f /ffplay.c | |
parent | 4ce75387cdcbcef8afbaadc5b66232c25178c0c6 (diff) | |
download | ffmpeg-148418a2bce3a7862f2d00ed4a424620c0d51e18.tar.gz |
ffplay: eliminate stream_component_close forward declaration
No change in fuctionality.
Signed-off-by: Marton Balint <cus@passwd.hu>
Diffstat (limited to 'ffplay.c')
-rw-r--r-- | ffplay.c | 116 |
1 files changed, 57 insertions, 59 deletions
@@ -1132,7 +1132,63 @@ static void video_audio_display(VideoState *s) } } -static void stream_component_close(VideoState *is, int stream_index); +static void stream_component_close(VideoState *is, int stream_index) +{ + AVFormatContext *ic = is->ic; + AVCodecContext *avctx; + + if (stream_index < 0 || stream_index >= ic->nb_streams) + return; + avctx = ic->streams[stream_index]->codec; + + switch (avctx->codec_type) { + case AVMEDIA_TYPE_AUDIO: + decoder_abort(&is->auddec, &is->sampq); + SDL_CloseAudio(); + decoder_destroy(&is->auddec); + swr_free(&is->swr_ctx); + av_freep(&is->audio_buf1); + is->audio_buf1_size = 0; + is->audio_buf = NULL; + + if (is->rdft) { + av_rdft_end(is->rdft); + av_freep(&is->rdft_data); + is->rdft = NULL; + is->rdft_bits = 0; + } + break; + case AVMEDIA_TYPE_VIDEO: + decoder_abort(&is->viddec, &is->pictq); + decoder_destroy(&is->viddec); + break; + case AVMEDIA_TYPE_SUBTITLE: + decoder_abort(&is->subdec, &is->subpq); + decoder_destroy(&is->subdec); + break; + default: + break; + } + + ic->streams[stream_index]->discard = AVDISCARD_ALL; + avcodec_close(avctx); + switch (avctx->codec_type) { + case AVMEDIA_TYPE_AUDIO: + is->audio_st = NULL; + is->audio_stream = -1; + break; + case AVMEDIA_TYPE_VIDEO: + is->video_st = NULL; + is->video_stream = -1; + break; + case AVMEDIA_TYPE_SUBTITLE: + is->subtitle_st = NULL; + is->subtitle_stream = -1; + break; + default: + break; + } +} static void stream_close(VideoState *is) { @@ -2737,64 +2793,6 @@ fail: return ret; } -static void stream_component_close(VideoState *is, int stream_index) -{ - AVFormatContext *ic = is->ic; - AVCodecContext *avctx; - - if (stream_index < 0 || stream_index >= ic->nb_streams) - return; - avctx = ic->streams[stream_index]->codec; - - switch (avctx->codec_type) { - case AVMEDIA_TYPE_AUDIO: - decoder_abort(&is->auddec, &is->sampq); - SDL_CloseAudio(); - decoder_destroy(&is->auddec); - swr_free(&is->swr_ctx); - av_freep(&is->audio_buf1); - is->audio_buf1_size = 0; - is->audio_buf = NULL; - - if (is->rdft) { - av_rdft_end(is->rdft); - av_freep(&is->rdft_data); - is->rdft = NULL; - is->rdft_bits = 0; - } - break; - case AVMEDIA_TYPE_VIDEO: - decoder_abort(&is->viddec, &is->pictq); - decoder_destroy(&is->viddec); - break; - case AVMEDIA_TYPE_SUBTITLE: - decoder_abort(&is->subdec, &is->subpq); - decoder_destroy(&is->subdec); - break; - default: - break; - } - - ic->streams[stream_index]->discard = AVDISCARD_ALL; - avcodec_close(avctx); - switch (avctx->codec_type) { - case AVMEDIA_TYPE_AUDIO: - is->audio_st = NULL; - is->audio_stream = -1; - break; - case AVMEDIA_TYPE_VIDEO: - is->video_st = NULL; - is->video_stream = -1; - break; - case AVMEDIA_TYPE_SUBTITLE: - is->subtitle_st = NULL; - is->subtitle_stream = -1; - break; - default: - break; - } -} - static int decode_interrupt_cb(void *ctx) { VideoState *is = ctx; |