From dd3857e6e91453582c063c015752c808938b1d9c Mon Sep 17 00:00:00 2001 From: Alexey Yakovenko Date: Thu, 24 Dec 2009 16:28:51 +0100 Subject: few minor fixes to ffmpeg plugin --- plugins/ffmpeg/ffmpeg.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'plugins/ffmpeg/ffmpeg.c') diff --git a/plugins/ffmpeg/ffmpeg.c b/plugins/ffmpeg/ffmpeg.c index 16ff37fd..64a071d5 100644 --- a/plugins/ffmpeg/ffmpeg.c +++ b/plugins/ffmpeg/ffmpeg.c @@ -84,6 +84,7 @@ ffmpeg_init (DB_playItem_t *it) { return -1; } + stream_id = -1; for (i = 0; i < fctx->nb_streams; i++) { ctx = fctx->streams[i]->codec; @@ -91,8 +92,10 @@ ffmpeg_init (DB_playItem_t *it) { { av_find_stream_info(fctx); codec = avcodec_find_decoder(ctx->codec_id); - if (codec != NULL) + if (codec != NULL) { + stream_id = i; break; + } } } @@ -102,7 +105,6 @@ ffmpeg_init (DB_playItem_t *it) { av_close_input_file(fctx); return -1; } - stream_id = i; trace ("ffmpeg can decode %s\n", it->fname); trace ("ffmpeg: codec=%s, stream=%d\n", codec->name, i); @@ -141,6 +143,9 @@ ffmpeg_free (void) { av_free_packet (&pkt); have_packet = 0; } + left_in_buffer = 0; + left_in_packet = 0; + stream_id = -1; if (fctx) { av_close_input_file(fctx); -- cgit v1.2.3