From efd53eed6148839234feb81b80c40d645811e038 Mon Sep 17 00:00:00 2001 From: mosu Date: Fri, 21 Jan 2005 18:25:44 +0000 Subject: [PATCH] Handle missing palettes in the info part of VobSubs in Matroska files correctly by giving mplayer a NULL pointer. This way it will use a default palette instead of black only. Patch by Csillag Kristof (fenwick () freemail ! hu) git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@14562 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpdemux/demux_mkv.c | 2 ++ libmpdemux/matroska.h | 1 + mplayer.c | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/libmpdemux/demux_mkv.c b/libmpdemux/demux_mkv.c index f3350789c5..70c9bd9250 100644 --- a/libmpdemux/demux_mkv.c +++ b/libmpdemux/demux_mkv.c @@ -373,6 +373,7 @@ vobsub_parse_palette (mkv_track_t *t, const char *start) t->sh_sub.palette[11], t->sh_sub.palette[12], t->sh_sub.palette[13], t->sh_sub.palette[14], t->sh_sub.palette[15]); + t->sh_sub.has_palette = 1; return 2; } return 0; @@ -480,6 +481,7 @@ demux_mkv_parse_idx (mkv_track_t *t) memcpy(buf, t->private_data, t->private_size); buf[t->private_size] = 0; t->sh_sub.type = 'v'; + t->sh_sub.has_palette = 0; pos = buf; start = buf; diff --git a/libmpdemux/matroska.h b/libmpdemux/matroska.h index b2abdb5411..7b89857b11 100644 --- a/libmpdemux/matroska.h +++ b/libmpdemux/matroska.h @@ -59,6 +59,7 @@ typedef struct { char type; // t = text, v = VobSub + int has_palette; // If we have a valid palette unsigned int palette[16]; // for VobSubs int width, height; // for VobSubs int custom_colors; diff --git a/mplayer.c b/mplayer.c index 8ae9b90899..ae644c97cc 100644 --- a/mplayer.c +++ b/mplayer.c @@ -3417,7 +3417,7 @@ if (stream->type==STREAMTYPE_DVDNAV && dvd_nav_still) if (vo_spudec != NULL) spudec_free(vo_spudec); vo_spudec = - spudec_new_scaled_vobsub(mkv_sh_sub->palette, mkv_sh_sub->colors, + spudec_new_scaled_vobsub(mkv_sh_sub->has_palette ? mkv_sh_sub->palette : NULL, mkv_sh_sub->colors, mkv_sh_sub->custom_colors, mkv_sh_sub->width, mkv_sh_sub->height);