diff options
author | 2009-12-24 16:28:51 +0100 | |
---|---|---|
committer | 2009-12-24 16:28:51 +0100 | |
commit | dd3857e6e91453582c063c015752c808938b1d9c (patch) | |
tree | 586ceab080e73d283d838f0220205da85b4ce962 /plugins/ffmpeg | |
parent | 72bfcc75182b10a9a9ce9daac526755ecf0a435e (diff) |
few minor fixes to ffmpeg plugin
Diffstat (limited to 'plugins/ffmpeg')
-rw-r--r-- | plugins/ffmpeg/ffmpeg.c | 9 |
1 files changed, 7 insertions, 2 deletions
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); |