Skip to content

Commit

Permalink
avformat/utils: dvd still frames read thru libdvdnav ended up in inte…
Browse files Browse the repository at this point in the history
…rnal lavf buffer

This is the solution we've been using in XBMC for over 2 years for dvd still frames.
The problem is that the demuxer asks for probing of the codec in the mpeg stream.
This causes lavf to read the whole menu structure into internal buffers.
After which, it won't read from input stream anymore and no events triggers.

Signed-off-by: Michael Niedermayer <[email protected]>
  • Loading branch information
Voyager1 authored and michaelni committed Feb 2, 2014
1 parent c81a9d1 commit 9f6f496
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libavformat/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@ static int probe_codec(AVFormatContext *s, AVStream *st, const AVPacket *pkt)

if (end || av_log2(pd->buf_size) != av_log2(pd->buf_size - pkt->size)) {
int score = set_codec_from_probe_data(s, st, pd);
if ( (st->codec->codec_id != AV_CODEC_ID_NONE && score > AVPROBE_SCORE_RETRY)
if ( (st->codec->codec_id != AV_CODEC_ID_NONE && score > AVPROBE_SCORE_RETRY-1)
|| end) {
pd->buf_size = 0;
av_freep(&pd->buf);
Expand Down

0 comments on commit 9f6f496

Please sign in to comment.