From f7163c80658651804437f9a7f5bed6fb34a32830 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 15 Nov 2012 21:09:15 +0100 Subject: 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.) --- demux/demux_lavf.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'demux') 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 -- cgit v1.2.3