diff mpcommon.c @ 31838:31ece8c6baed

Move initialization of vo_spudec further behind to avoid issues with PGS subtitles being scaled incorrectly.
author reimar
date Tue, 03 Aug 2010 17:09:16 +0000
parents a6abbb323d04
children 436e56c6da9b
line wrap: on
line diff
--- a/mpcommon.c	Tue Aug 03 17:01:13 2010 +0000
+++ b/mpcommon.c	Tue Aug 03 17:09:16 2010 +0000
@@ -133,8 +133,6 @@
     if (vo_config_count &&
         (vobsub_id >= 0 || type == 'v')) {
         int timestamp;
-        if (!vo_spudec)
-            vo_spudec = spudec_new(NULL);
         current_module = "spudec";
         /* Get a sub packet from the DVD or a vobsub */
         while(1) {
@@ -167,6 +165,12 @@
                 }
             }
             if (len<=0 || !packet) break;
+            // create it only here, since with some broken demuxers we might
+            // type = v but no DVD sub and we currently do not change the
+            // "original frame size" ever after init, leading to wrong-sized
+            // PGS subtitles.
+            if (!vo_spudec)
+                vo_spudec = spudec_new(NULL);
             if (vo_vobsub || timestamp >= 0)
                 spudec_assemble(vo_spudec, packet, len, timestamp);
         }