summaryrefslogtreecommitdiffstats
path: root/libmpdemux/demux_lavf.c
diff options
context:
space:
mode:
authorUoti Urpala <uau@mplayer2.org>2011-04-02 22:39:01 +0300
committerUoti Urpala <uau@mplayer2.org>2011-04-02 22:53:18 +0300
commite3631231a1be57cbf854d5897cd9378249ffd865 (patch)
tree13318a93e2ceae5f844e9112c0f72cab8b81c17b /libmpdemux/demux_lavf.c
parent1bda89eabac6414d5f0f34d445793e9745b74e94 (diff)
downloadmpv-e3631231a1be57cbf854d5897cd9378249ffd865.tar.bz2
mpv-e3631231a1be57cbf854d5897cd9378249ffd865.tar.xz
demux_mkv, demux_lavf: don't select initial audio track
Remove code that tries to select audio track during demuxer initialization from demux_mkv and demux_lavf. Just leave audio disabled at that point; the higher-level select_audio() function will call the demuxer to switch track later anyway. Removing this unneeded code also fixes use of these demuxers as the main demuxer with -audiofile. Before the automatic track selection would have enabled an audio track (if the file had any); as the main demuxer was not used for audio the unused packets from this enabled track would accumulate until they reached queue size limits.
Diffstat (limited to 'libmpdemux/demux_lavf.c')
-rw-r--r--libmpdemux/demux_lavf.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/libmpdemux/demux_lavf.c b/libmpdemux/demux_lavf.c
index 4c6ddac2a7..ed8a3ddb69 100644
--- a/libmpdemux/demux_lavf.c
+++ b/libmpdemux/demux_lavf.c
@@ -357,12 +357,7 @@ static void handle_stream(demuxer_t *demuxer, AVFormatContext *avfc, int i) {
if (st->disposition & AV_DISPOSITION_DEFAULT)
sh_audio->default_track = 1;
if(mp_msg_test(MSGT_HEADER,MSGL_V) ) print_wave_header(sh_audio->wf, MSGL_V);
- // select the first audio stream
- if (!demuxer->audio->sh) {
- demuxer->audio->id = i;
- demuxer->audio->sh= demuxer->a_streams[i];
- } else
- st->discard= AVDISCARD_ALL;
+ st->discard= AVDISCARD_ALL;
stream_id = priv->audio_streams++;
break;
}
@@ -611,8 +606,7 @@ static demuxer_t* demux_open_lavf(demuxer_t *demuxer){
mp_msg(MSGT_HEADER,MSGL_V,"LAVF: %d audio and %d video streams found\n",priv->audio_streams,priv->video_streams);
mp_msg(MSGT_HEADER,MSGL_V,"LAVF: build %d\n", LIBAVFORMAT_BUILD);
- if(!priv->audio_streams) demuxer->audio->id=-2; // nosound
-// else if(best_audio > 0 && demuxer->audio->id == -1) demuxer->audio->id=best_audio;
+ 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");