[MPlayer-cvslog] r21136 - trunk/mplayer.c

reimar subversion at mplayerhq.hu
Tue Nov 21 16:48:00 CET 2006


Author: reimar
Date: Tue Nov 21 16:48:00 2006
New Revision: 21136

Modified:
   trunk/mplayer.c

Log:
Reuse init_vo_spudec in subtitle switching code.
Also generalize vobsub and ass init code to work for demuxers
besides matroska (fixes subtitle switching with
http://samples.mplayerhq.hu/sub/NeroMP4/unsupported-embedded-subs-2.mp4)


Modified: trunk/mplayer.c
==============================================================================
--- trunk/mplayer.c	(original)
+++ trunk/mplayer.c	Tue Nov 21 16:48:00 2006
@@ -2379,32 +2379,15 @@
             }
             if (demuxer->type == DEMUXER_TYPE_MATROSKA) {
                 d_dvdsub->id = demux_mkv_change_subs(demuxer, dvdsub_id);
+            }
+            if (d_dvdsub->sh && d_dvdsub->id >= 0) {
+                sh_sub_t *sh = d_dvdsub->sh;
+                if (sh->type == 'v')
+                    init_vo_spudec();
 #ifdef USE_ASS
-                if (ass_enabled && (d_dvdsub->id >= 0) &&
-                        (((sh_sub_t *)d_dvdsub->sh)->type == 'a')) {
-                    ass_track = ((sh_sub_t *)d_dvdsub->sh)->ass_track;
-                }
-#endif
-                if (d_dvdsub->id >= 0 &&
-                    ((sh_sub_t *)d_dvdsub->sh)->type == 'v') {
-                    sh_sub_t *mkv_sh_sub = (sh_sub_t *)d_dvdsub->sh;
-                    if (vo_spudec != NULL)
-                        spudec_free(vo_spudec);
-                    vo_spudec =
-                        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);
-                    if (!forced_subs_only)
-                        forced_subs_only = mkv_sh_sub->forced_subs_only;
-                    if (vo_spudec) {
-                        spudec_set_forced_subs_only(vo_spudec,
-                                                    forced_subs_only);
-                        inited_flags |= INITED_SPUDEC;
-                    }
-                }
+                else if (ass_enabled && sh->type == 'a')
+                    ass_track = sh->ass_track;
+#endif
             }
         }
     } else { // off



More information about the MPlayer-cvslog mailing list