From 9a731a9b0df80590a7808b8d0628b84d06c66005 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 19 Mar 2013 02:27:47 +0100 Subject: demux: fix regressions by restricting cover art hack further The code modified by this commit is supposed to prevent demuxing the whole file when cover art is present. (The problem with cover art is that the ffmpeg libavformat API doesn't signal video EOF correctly - so we try to read more packets to find the next video frame, which results in demuxing and queuing the whole audio stream.) This caused regressions for files with extremely high audio offset (see github issue #46). MY conclusion is that this cover art crap doesn't work, and this is just another case of completely insane ffmpeg/libav API. Disable the hack in all cases, unless a cover art video track is selected. Maybe I'll handle cover art directly in the frontend later, so that we don't have to rely on whatever libavformat does. Unfortunately, this also makes behavior with equally insane mp4 files with sparse video tracks worse, but this issue takes priority. --- demux/demux.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'demux/demux.c') diff --git a/demux/demux.c b/demux/demux.c index eaf1062cb2..775dbfa845 100644 --- a/demux/demux.c +++ b/demux/demux.c @@ -678,9 +678,9 @@ int ds_fill_buffer(demux_stream_t *ds) break; // EOF } - if (demux->type == DEMUXER_TYPE_LAVF || - demux->type == DEMUXER_TYPE_MATROSKA) - { + struct sh_video *sh_video = demux->video->sh; + + if (sh_video && sh_video->gsh->attached_picture) { if (demux->audio) ds->fill_count += demux->audio->packs - apacks; if (demux->video && demux->video->packs > vpacks) -- cgit v1.2.3