[PATCH] Check for correct spu_channel in HDMV decoder

Mikko Rasa <[email protected]> Sat, 08 Feb 2014 20:17:04 +0200
Newsgroups gmane.comp.video.xine.devel
Message-ID <[email protected]>
I recently got a Blu-Ray drive and started backing up my movie 
collection to mkv files.  I noticed that when I played back a file with 
more than one HDMV subtitle track, I would get subtitles in random 
languages.  I quickly concluded that all subtitle tracks were actually 
playing at once, and selecting a particular track from the UI did nothing.

The attached patch fixes this problem.  I simply copied the relevant 
check from sputext_decoder.c.  There are some other checks that are 
suspiciously missing from spuhdmv_decoder.c as well, but as this is my 
first attempt at hacking Xine, I'm not certain enough of their purpose.

-- 
Mikko

------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk

_______________________________________________
xine-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xine-devel
spu_channel.patch (text/x-diff, 665 B)
# HG changeset patch
# User Mikko Rasa <[email protected]>
# Date 1391881836 -7200
#      Sat Feb 08 19:50:36 2014 +0200
# Node ID 155c153554bed5ee65bc02fa7f4b9bdf81b75739
# Parent  385963200e4776836d8270c97badfe961008593f
Check for correct spu_channel in HDMV decoder

diff -r 385963200e47 -r 155c153554be src/spu_dec/spuhdmv_decoder.c
--- a/src/spu_dec/spuhdmv_decoder.c	Fri Feb 07 16:47:10 2014 +0100
+++ b/src/spu_dec/spuhdmv_decoder.c	Sat Feb 08 19:50:36 2014 +0200
@@ -969,6 +969,9 @@
   if ((buf->type & 0xffff0000) != BUF_SPU_HDMV)
     return;
 
+  if ((this->stream->spu_channel & 0x1f) != (buf->type & 0x1f))
+    return;
+
   if (buf->size < 1)
     return;