diff mbox series

[FFmpeg-devel,5/5] avformat/matroskaenc: Don't pretend to be able to mux RV30

Message ID AS8P250MB074403CE27EBEA31A12AD2DC8F0FA@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM
State Accepted
Commit 1df13b3891aa5fd482bfe9ff9e455b39e0a3cd38
Headers show
Series [FFmpeg-devel,1/5] avformat/matroskaenc: Support rotations | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Andreas Rheinhardt Aug. 6, 2023, 11:06 p.m. UTC
The demuxer uses a extradata offset of 26, so we would need
to recreate the missing 26 bytes somehow in the muxer, but
we just don't. Remuxed files (like real/rv30.rm from the FATE-suite)
don't work due to missing extradata.

(The extradata offset also applies to RV40 and the extradata
is indeed lost upon remuxing, yet remuxing real/spygames-2MB.rmvb
works; our RV40 decoder does not use extradata at all.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavformat/matroskaenc.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)
diff mbox series

Patch

diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
index a9b7f89f38..be70e7a6f1 100644
--- a/libavformat/matroskaenc.c
+++ b/libavformat/matroskaenc.c
@@ -3300,7 +3300,8 @@  static int mkv_init(struct AVFormatContext *s)
             s->streams[i]->codecpar->codec_id == AV_CODEC_ID_RA_288 ||
             s->streams[i]->codecpar->codec_id == AV_CODEC_ID_SIPR ||
             s->streams[i]->codecpar->codec_id == AV_CODEC_ID_RV10 ||
-            s->streams[i]->codecpar->codec_id == AV_CODEC_ID_RV20) {
+            s->streams[i]->codecpar->codec_id == AV_CODEC_ID_RV20 ||
+            s->streams[i]->codecpar->codec_id == AV_CODEC_ID_RV30) {
             av_log(s, AV_LOG_ERROR,
                    "The Matroska muxer does not yet support muxing %s\n",
                    avcodec_get_name(s->streams[i]->codecpar->codec_id));
@@ -3430,11 +3431,6 @@  static const AVCodecTag additional_audio_tags[] = {
     { AV_CODEC_ID_NONE,      0xFFFFFFFF }
 };
 
-static const AVCodecTag additional_video_tags[] = {
-    { AV_CODEC_ID_RV30,      0xFFFFFFFF },
-    { AV_CODEC_ID_NONE,      0xFFFFFFFF }
-};
-
 static const AVCodecTag additional_subtitle_tags[] = {
     { AV_CODEC_ID_DVB_SUBTITLE,      0xFFFFFFFF },
     { AV_CODEC_ID_DVD_SUBTITLE,      0xFFFFFFFF },
@@ -3506,7 +3502,7 @@  const FFOutputFormat ff_matroska_muxer = {
                          AVFMT_TS_NONSTRICT | AVFMT_ALLOW_FLUSH,
     .p.codec_tag       = (const AVCodecTag* const []){
          ff_codec_bmp_tags, ff_codec_wav_tags,
-         additional_audio_tags, additional_video_tags, additional_subtitle_tags, 0
+         additional_audio_tags, additional_subtitle_tags, 0
     },
     .p.subtitle_codec  = AV_CODEC_ID_ASS,
     .query_codec       = mkv_query_codec,