In case this patch got lost in my endless stream of previous posts, I'll
repost it. Description of the patch follows:
In order to make MPlayer use the correct palette when playing palettized
QuickTime video in Matroska, the palette will need to be copied to
st->codec->extradata in matroskadec.c. As I have explained so many times
before, for some inexplicable reason, MPlayer in its current state adds
*another* palette side data packet *after* the one added in
matroskadec.c, using whatever is in extradata as the palette.
Since this copying to st->codec->extradata is done for V_MS/VFW/FOURCC,
I see no reason why it couldn't be done for V_QUICKTIME as well. I have
yet to see any program use the extradata for anything else than the
palette when it comes to palettized video in Matroska. I might be wrong,
of course.
If this patch is not acceptable, we'll have to tell the MPlayer
maintainers to fix this extraneous addition of yet another palette side
data packet. Unfortunately, in my experience, they seem rather slow on
reacting. I would therefore be grateful if someone of the more
"influential" persons here could bring this issue up in their community.
Sample palettized Matroska files for testing are available at
https://drive.google.com/open?id=0B3_pEBoLs0faWElmM2FnLTZYNlk.
Mats
--
Mats Peterson
http://matsp888.no-ip.org/~mats/
>From e6202f0f7caa9c82915b2fa3276b263d16d1aaaa Mon Sep 17 00:00:00 2001
From: Mats Peterson <matsp...@yahoo.com>
Date: Mon, 28 Dec 2015 05:12:49 +0100
Subject: [PATCH] lavf/matroskadec.c: Copy QuickTime palette to st->codec->extradata
In case this patch got lost in my endless stream of previous posts, I'll
repost it. Description of the patch follows:
In order to make MPlayer use the correct palette when playing palettized
QuickTime video in Matroska, the palette will need to be copied to
st->codec->extradata in matroskadec.c. As I have explained so many times
before, for some inexplicable reason, MPlayer in its current state adds
*another* palette side data packet *after* the one added in
matroskadec.c, using whatever is in extradata as the palette.
Since this copying to st->codec->extradata is done for V_MS/VFW/FOURCC,
I see no reason why it couldn't be done for V_QUICKTIME as well. I have
yet to see any program use the extradata for anything else than the
palette when it comes to palettized video in Matroska. I might be wrong,
of course.
If this patch is not acceptable, we'll have to tell the MPlayer
maintainers to fix this extraneous addition of yet another palette side
data packet. Unfortunately, in my experience, they seem rather slow on
reacting. I would therefore be grateful if someone of the more
"influential" persons here could bring this issue up in their community.
Sample palettized Matroska files for testing are available at
https://drive.google.com/open?id=0B3_pEBoLs0faWElmM2FnLTZYNlk.
Mats
---
libavformat/matroskadec.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index 9de7cfb..d788dce 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -1893,6 +1893,15 @@ static int matroska_parse_tracks(AVFormatContext *s)
0, NULL, NULL, NULL, NULL);
if (ff_get_qtpalette(codec_id, &b, matroska->palette)) {
bit_depth &= 0x1F;
+ /* Copy the palette to extradata. This is needed
+ * because MPlayer currently adds *another* palette
+ * side data packet *after* the one added in
+ * matroska_deliver_packet(), using whatever is in
+ * extradata as the palette. */
+ if (ff_alloc_extradata(st->codec, AVPALETTE_SIZE))
+ return AVERROR(ENOMEM);
+ memcpy(st->codec->extradata, matroska->palette,
+ AVPALETTE_SIZE);
matroska->has_palette = 1;
}
}
--
1.7.10.4
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel