Showing the changes to libavformat (1 of 1 file). Show all
Unified · Split
| @@ -1338,12 +1338,26 @@ retry: · 1337 unmodified lines | ||
| 1338 | 1338 | pkt_type = flags & ~FLV_AUDIO_CODECID_MASK; |
| 1339 | 1339 | |
| 1340 | 1340 | if (pkt_type == AudioPacketTypeMultitrack) { |
| 1341 | − av_log(s, AV_LOG_ERROR, "Multitrack audio is unsupported!\n"); | |
| 1342 | − return AVERROR_PATCHWELCOME; | |
| 1341 | + uint8_t types = avio_r8(s->pb); | |
| 1342 | + int multitrack_type = types >> 4; | |
| 1343 | + pkt_type = types & 0xF; | |
| 1344 | + | |
| 1345 | + if (multitrack_type != MultitrackTypeOneTrack) { | |
| 1346 | + av_log(s, AV_LOG_ERROR, "Audio multitrack types other than MultitrackTypeOneTrack are unsupported!\n"); | |
| 1347 | + return AVERROR_PATCHWELCOME; | |
| 1348 | + } | |
| 1349 | + | |
| 1350 | + multitrack = 1; | |
| 1351 | + size--; | |
| 1343 | 1352 | } |
| 1344 | 1353 | |
| 1345 | 1354 | codec_id = avio_rb32(s->pb); |
| 1346 | 1355 | size -= 4; |
| 1356 | + | |
| 1357 | + if (multitrack) { | |
| 1358 | + track_idx = avio_r8(s->pb); | |
| 1359 | + size--; | |
| 1360 | + } | |
| 1347 | 1361 | } |
| 1348 | 1362 | } else if (type == FLV_TAG_TYPE_VIDEO) { |
| 1349 | 1363 | stream_type = FLV_STREAM_TYPE_VIDEO; |
| @@ -1440,7 +1454,8 @@ skip: · 90 unmodified lines | ||
| 1440 | 1454 | st = s->streams[i]; |
| 1441 | 1455 | if (stream_type == FLV_STREAM_TYPE_AUDIO) { |
| 1442 | 1456 | if (st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO && |
| 1443 | − (s->audio_codec_id || flv_same_audio_codec(st->codecpar, flags, codec_id))) | |
| 1457 | + (s->audio_codec_id || flv_same_audio_codec(st->codecpar, flags, codec_id)) && | |
| 1458 | + st->id == track_idx) | |
| 1444 | 1459 | break; |
| 1445 | 1460 | } else if (stream_type == FLV_STREAM_TYPE_VIDEO) { |
| 1446 | 1461 | if (st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO && |