summaryrefslogtreecommitdiffstats
path: root/demux/demux.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2012-12-08 13:59:49 +0100
committerwm4 <wm4@nowhere>2012-12-11 00:37:54 +0100
commit5bf8706d1f6536cd89207b777161ab83195ddb20 (patch)
tree1e4ba07a00da6dcde3f8f308f2aa1128af56619e /demux/demux.c
parentb3fb7c2cade9d70a4ca05821c87f68e941da6237 (diff)
downloadmpv-5bf8706d1f6536cd89207b777161ab83195ddb20.tar.bz2
mpv-5bf8706d1f6536cd89207b777161ab83195ddb20.tar.xz
sub: remove vobsub reader in favor of ffmpeg vobsub demuxer
ffmpeg recently added a demuxer that can read vobsubs (pairs of .sub and .idx files). Get rid of the internal vobsub reader, and use the ffmpeg demuxer instead. Sneak in an unrelated manpage change (autosub default).
Diffstat (limited to 'demux/demux.c')
-rw-r--r--demux/demux.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/demux/demux.c b/demux/demux.c
index f765b2ae87..41b74b20c4 100644
--- a/demux/demux.c
+++ b/demux/demux.c
@@ -459,6 +459,16 @@ void free_demuxer(demuxer_t *demuxer)
void ds_add_packet(demux_stream_t *ds, demux_packet_t *dp)
{
+ // demux API can't handle 0-sized packets, but at least some vobsubs
+ // generate them. Skipping them seems to work fine. Not skipping them will
+ // stop demuxing with external vobsubs. See FATE sub/vobsub.{idx,sub} at
+ // pts=185.91.
+ if (dp->len == 0 && ds->stream_type == STREAM_SUB) {
+ mp_dbg(MSGT_DEMUXER, MSGL_INFO, "Discarding empty subtitle packet.\n");
+ free_demux_packet(dp);
+ return;
+ }
+
// append packet to DS stream:
++ds->packs;
ds->bytes += dp->len;