summaryrefslogtreecommitdiffstats
path: root/mpcommon.c
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2010-07-10 18:11:05 +0000
committerUoti Urpala <uau@glyph.nonexistent.invalid>2010-11-02 04:14:43 +0200
commit0eb5662a051caab194f26c20f1277b28dc7bca76 (patch)
tree3b7b59e9ae593abfa3f892813b4fe9bf91bc5195 /mpcommon.c
parent29f20dc812f49e6b4648a9c045a35bbfa0f7a961 (diff)
downloadmpv-0eb5662a051caab194f26c20f1277b28dc7bca76.tar.bz2
mpv-0eb5662a051caab194f26c20f1277b28dc7bca76.tar.xz
subs: Automatically allocate a vo_spudec if there is none
Allows playback of DVD subtitles from "raw" MPEG-PS. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31674 b3059339-0415-0410-9bf9-f77b7e298cf2 Move initialization of vo_spudec further behind to avoid issues with PGS subtitles being scaled incorrectly. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31917 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'mpcommon.c')
-rw-r--r--mpcommon.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/mpcommon.c b/mpcommon.c
index 66f2eece8c..b9f9c13ff6 100644
--- a/mpcommon.c
+++ b/mpcommon.c
@@ -135,7 +135,7 @@ void update_subtitles(struct MPContext *mpctx, struct MPOpts *opts,
}
// DVD sub:
- if (vo_spudec && (vobsub_id >= 0 || (opts->sub_id >= 0 && type == 'v'))) {
+ if (vobsub_id >= 0 || (opts->sub_id >= 0 && type == 'v')) {
int timestamp;
current_module = "spudec";
/* Get a sub packet from the DVD or a vobsub */
@@ -169,6 +169,12 @@ void update_subtitles(struct MPContext *mpctx, struct MPOpts *opts,
}
}
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);
}