summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-03-19 02:27:47 +0100
committerwm4 <wm4@nowhere>2013-03-19 02:27:47 +0100
commit9a731a9b0df80590a7808b8d0628b84d06c66005 (patch)
treeb7102f0113925ab83536e16e749d0abbb9ffeb7b
parentbe7e04f7198ed6092a1d1e54e867df9b2c6247a4 (diff)
downloadmpv-9a731a9b0df80590a7808b8d0628b84d06c66005.tar.bz2
mpv-9a731a9b0df80590a7808b8d0628b84d06c66005.tar.xz
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.
-rw-r--r--demux/demux.c6
1 files changed, 3 insertions, 3 deletions
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)