ffmpeg av_find_best_stream() returns garbage for some audio files
authorAli Gholami Rudi <ali@rudi.ir>
Wed, 7 Sep 2011 06:41:34 +0000 (7 11:11 +0430)
committerAli Gholami Rudi <ali@rudi.ir>
Wed, 7 Sep 2011 06:41:34 +0000 (7 11:11 +0430)
ffs.c

diff --git a/ffs.c b/ffs.c
index d682abb..6152efd 100644 (file)
--- a/ffs.c
+++ b/ffs.c
@@ -37,7 +37,7 @@ struct ffs *ffs_alloc(char *path, int video)
        if (av_find_stream_info(ffs->fc) < 0)
                goto failed;
        ffs->si = av_find_best_stream(ffs->fc, type, -1, -1, NULL, 0);
-       if (ffs->si == -1)
+       if (ffs->si < 0)
                goto failed;
        ffs->cc = ffs->fc->streams[ffs->si]->codec;
        avcodec_open(ffs->cc, avcodec_find_decoder(ffs->cc->codec_id));