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.
This commit is contained in:
wm4 2013-03-19 02:27:47 +01:00
parent be7e04f719
commit 9a731a9b0d
1 changed files with 3 additions and 3 deletions

View File

@ -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)