1
0
mirror of https://github.com/mpv-player/mpv synced 2025-01-09 00:19:32 +00:00

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
This commit is contained in:
reimar 2010-07-10 18:11:05 +00:00 committed by Uoti Urpala
parent 29f20dc812
commit 0eb5662a05

View File

@ -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);
}