diff options
author | wm4 <wm4@nowhere> | 2012-11-15 21:09:15 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2012-11-16 21:21:16 +0100 |
commit | f7163c80658651804437f9a7f5bed6fb34a32830 (patch) | |
tree | c9ddd879009278cb2204cc598621039ea971b932 /demux | |
parent | 589bda26cec162e1e27a8e40b333ca198a621b3f (diff) | |
download | mpv-f7163c80658651804437f9a7f5bed6fb34a32830.tar.bz2 mpv-f7163c80658651804437f9a7f5bed6fb34a32830.tar.xz |
subtitles: improve support for libavformat demuxed subtitles
Make demux_lavf not error out if no video or audio track is present.
This allows opening subtitle files with the demuxer.
Improve the test whether subtitles read from demuxers must do explicit
packet reads. (I'm not sure whether always doing these reads could have
bad effects, such as reading too many audio and video packets at once,
so be conservative.)
Diffstat (limited to 'demux')
-rw-r--r-- | demux/demux_lavf.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/demux/demux_lavf.c b/demux/demux_lavf.c index a411441873..769cf02101 100644 --- a/demux/demux_lavf.c +++ b/demux/demux_lavf.c @@ -693,12 +693,7 @@ static demuxer_t *demux_open_lavf(demuxer_t *demuxer) mp_msg(MSGT_HEADER, MSGL_V, "LAVF: build %d\n", LIBAVFORMAT_BUILD); demuxer->audio->id = -2; // wait for higher-level code to select track if (!priv->video_streams) { - if (!priv->audio_streams) { - mp_msg(MSGT_HEADER, MSGL_ERR, - "LAVF: no audio or video headers found - broken file?\n"); - return NULL; - } - demuxer->video->id = -2; // audio-only + demuxer->video->id = -2; // audio-only / sub-only } // disabled because unreliable per-stream bitrate values returned |