]> git.sesse.net Git - ffmpeg/commitdiff
avformat/matroskadec: Simplify check for RealAudio
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Mon, 2 Dec 2019 10:04:55 +0000 (11:04 +0100)
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Fri, 1 May 2020 05:11:40 +0000 (07:11 +0200)
They need a special parsing mode and in order to find out whether this
mode is in use, several checks have to be performed. They can all be
combined into one: If the buffer that is only used to assemble their
packets has been allocated, use the RealAudio parsing mode.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
libavformat/matroskadec.c

index 8c65e98e77c76687600fc951747c6a932616790a..668323ba08ef4089f1a3f9f839eff902e3a09e09 100644 (file)
@@ -3617,11 +3617,7 @@ static int matroska_parse_block(MatroskaDemuxContext *matroska, AVBufferRef *buf
     for (n = 0; n < laces; n++) {
         int64_t lace_duration = block_duration*(n+1) / laces - block_duration*n / laces;
 
-        if ((st->codecpar->codec_id == AV_CODEC_ID_RA_288 ||
-             st->codecpar->codec_id == AV_CODEC_ID_COOK   ||
-             st->codecpar->codec_id == AV_CODEC_ID_SIPR   ||
-             st->codecpar->codec_id == AV_CODEC_ID_ATRAC3) &&
-            st->codecpar->block_align && track->audio.sub_packet_size) {
+        if (track->audio.buf) {
             res = matroska_parse_rm_audio(matroska, track, st, data,
                                           lace_size[n],
                                           timecode, pos);