changeset 35446:a25cdaa733cb

Display correct subtitle language for demux_lavf.
author reimar
date Fri, 30 Nov 2012 21:22:32 +0000
parents 19c56dc40a51
children 825d6e1cad3e
files command.c
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/command.c	Fri Nov 30 20:51:02 2012 +0000
+++ b/command.c	Fri Nov 30 21:22:32 2012 +0000
@@ -1492,7 +1492,12 @@
         }
         if (dvdsub_id >= 0) {
             char lang[40] = MSGTR_Unknown;
-            demuxer_sub_lang(mpctx->demuxer, dvdsub_id, lang, sizeof(lang));
+            int id = dvdsub_id;
+            // HACK: for DVDs sub->sh/id will be invalid until
+            // we actually get the first packet
+            if (d_sub && d_sub->sh)
+                id = d_sub->id;
+            demuxer_sub_lang(mpctx->demuxer, id, lang, sizeof(lang));
             snprintf(*(char **) arg, 63, "(%d) %s", dvdsub_id, lang);
             return M_PROPERTY_OK;
         }