]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/mp3dec.c
opus_rc: rename total_bits_used to total_bits and #define some constants
[ffmpeg] / libavformat / mp3dec.c
index 56c7f8caee2e8617550ece4e6d5880e601861dcd..b45a066686f0d33d134a79d8d6d7623822e20964 100644 (file)
@@ -349,6 +349,9 @@ static int mp3_read_header(AVFormatContext *s)
     int ret;
     int i;
 
+    s->metadata = s->internal->id3v2_meta;
+    s->internal->id3v2_meta = NULL;
+
     st = avformat_new_stream(s, NULL);
     if (!st)
         return AVERROR(ENOMEM);
@@ -457,7 +460,8 @@ static int check(AVIOContext *pb, int64_t pos, uint32_t *ret_header)
         return CHECK_SEEK_FAILED;
 
     ret = avio_read(pb, &header_buf[0], 4);
-    if (ret < 0)
+    /* We should always find four bytes for a valid mpa header. */
+    if (ret < 4)
         return CHECK_SEEK_FAILED;
 
     header = AV_RB32(&header_buf[0]);