]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/flvdec.c
Merge commit '124134e42455763b28cc346fed1d07017a76e84e'
[ffmpeg] / libavformat / flvdec.c
index bf1ff98fdee9f68c4e44d433a58e9a9deb1d4554..c7b692273fc447b934d57890cb66b80fe0ed2bb9 100644 (file)
@@ -126,8 +126,6 @@ static int flv_same_audio_codec(AVCodecContext *acodec, int flags)
     default:
         return acodec->codec_tag == (flv_codecid >> FLV_AUDIO_CODECID_OFFSET);
     }
-
-    return 0;
 }
 
 static void flv_set_audio_codec(AVFormatContext *s, AVStream *astream, AVCodecContext *acodec, int flv_codecid) {
@@ -198,8 +196,6 @@ static int flv_same_video_codec(AVCodecContext *vcodec, int flags)
         default:
             return vcodec->codec_tag == flv_codecid;
     }
-
-    return 0;
 }
 
 static int flv_set_video_codec(AVFormatContext *s, AVStream *vstream, int flv_codecid) {
@@ -713,17 +709,20 @@ static int flv_read_packet(AVFormatContext *s, AVPacket *pkt)
     /* now find stream */
     for(i=0;i<s->nb_streams;i++) {
         st = s->streams[i];
-        if (stream_type == FLV_STREAM_TYPE_AUDIO && st->codec->codec_type == AVMEDIA_TYPE_AUDIO) {
-            if (flv_same_audio_codec(st->codec, flags)) {
+        if (stream_type == FLV_STREAM_TYPE_AUDIO) {
+            if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO &&
+                flv_same_audio_codec(st->codec, flags)) {
                 break;
             }
         } else
-        if (stream_type == FLV_STREAM_TYPE_VIDEO && st->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
-            if (flv_same_video_codec(st->codec, flags)) {
+        if (stream_type == FLV_STREAM_TYPE_VIDEO) {
+            if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO &&
+                flv_same_video_codec(st->codec, flags)) {
                 break;
             }
-        } else if (st->id == stream_type) {
-            break;
+        } else if (stream_type == FLV_STREAM_TYPE_DATA) {
+            if (st->codec->codec_type == AVMEDIA_TYPE_DATA)
+                break;
         }
     }
     if(i == s->nb_streams){