summaryrefslogtreecommitdiffstats
path: root/demux
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-02-13 22:54:15 +0100
committerwm4 <wm4@nowhere>2014-03-11 00:08:29 +0100
commite4c69376fc13c21a8ecb09a45d01045f88f40b58 (patch)
tree2d8884b923aa92c09a672f13a7c0731f1109ca59 /demux
parent842689bbf632218eacfd84dfab2b83d6954bdc93 (diff)
downloadmpv-e4c69376fc13c21a8ecb09a45d01045f88f40b58.tar.bz2
mpv-e4c69376fc13c21a8ecb09a45d01045f88f40b58.tar.xz
sub: handle vobsub-in-mp4
The mplayer decoder (spudec.c) actually handled this. There was explicit code for binary palettes (16 32 bit values), and the subtitle resolution was handled by video resolution coincidentally matching the subtitle resolution. Whoever puts vobsub into mp4 should be punished. Fixes the sample gundam_sample.mp4, closes github issue #547.
Diffstat (limited to 'demux')
-rw-r--r--demux/demux_lavf.c2
-rw-r--r--demux/stheader.h1
2 files changed, 3 insertions, 0 deletions
diff --git a/demux/demux_lavf.c b/demux/demux_lavf.c
index 1d1d310247..80a2e5fad4 100644
--- a/demux/demux_lavf.c
+++ b/demux/demux_lavf.c
@@ -458,6 +458,8 @@ static void handle_stream(demuxer_t *demuxer, int i)
memcpy(sh_sub->extradata, codec->extradata, codec->extradata_size);
sh_sub->extradata_len = codec->extradata_size;
}
+ sh_sub->w = codec->width;
+ sh_sub->h = codec->height;
// Hack for MicroDVD: if time_base matches the ffmpeg microdvd reader's
// default FPS (23.976), assume the MicroDVD file did not declare a
diff --git a/demux/stheader.h b/demux/stheader.h
index 25f60ba032..177bf50b39 100644
--- a/demux/stheader.h
+++ b/demux/stheader.h
@@ -87,6 +87,7 @@ typedef struct sh_video {
typedef struct sh_sub {
unsigned char *extradata; // extra header data passed from demuxer
int extradata_len;
+ int w, h; // mp4 vobsubs
int frame_based; // timestamps are frame-based
bool is_utf8; // if false, subtitle packet charset is unknown
struct ass_track *track; // loaded by libass