On Mon, Jan 14, 2013 at 10:28:57PM +0100, Alexandra Khirnova wrote:
> From: Joakim Plate <[email protected]>
>
> This is how Matroska store palette information for vobsubs
storeS
> --- a/libavcodec/dvdsubdec.c
> +++ b/libavcodec/dvdsubdec.c
> @@ -25,6 +25,11 @@
>
> +typedef struct DVDSubContext {
> + uint32_t palette[16];
> + int has_palette;
> +} DVDSubContext;
Use four spaces for indentation.
> @@ -159,13 +172,13 @@ static void guess_palette(uint32_t *rgba_palette,
>
> -static int decode_dvd_subtitles(AVSubtitle *sub_header,
> +static int decode_dvd_subtitles(DVDSubContext *ctx, AVSubtitle *sub_header,
> const uint8_t *buf, int buf_size)
> {
> int cmd_pos, pos, cmd, x1, y1, x2, y2, offset1, offset2, next_cmd_pos;
> int big_offsets, offset_size, is_8bit = 0;
> const uint8_t *yuv_palette = 0;
> - uint8_t colormap[4], alpha[256];
> + uint8_t colormap[4] = {0}, alpha[256] = {0};
{ 0 }
> @@ -484,10 +499,54 @@ static int dvdsub_decode(AVCodecContext *avctx,
> +
> + if (ctx->has_palette) {
> + int i;
> + av_log(avctx, AV_LOG_DEBUG, "palette:");
> + for (i = 0; i < 16; i++)
> + av_log(avctx, AV_LOG_DEBUG, " 0x%06x", ctx->palette[i]);
> + av_log(avctx, AV_LOG_DEBUG, "\n");
> + }
This should be av_dlog IMO.
Diego
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel