From 90a3ab0d766e3a026a37f7290f59abda30c4de32 Mon Sep 17 00:00:00 2001
From: elupus <elupus@xbmc.org>
Date: Tue, 17 Apr 2012 01:13:15 +0200
Subject: [PATCH] fixed: dvd still frames ended up in internal lavf buffer

This is very hackish, but it's the old solution we had 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.

The only proper fix to avoid this is to allow this situation
in our navigator. This needs further work so that we can
process HOP/ACTIVATION events in libdvdnav without advancing
stream.
---
 libavformat/utils.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index 1bf81a5..051dcc0 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -833,7 +833,7 @@ int av_read_packet(AVFormatContext *s, 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 != CODEC_ID_NONE && score > AVPROBE_SCORE_MAX/4)
+                if(    (st->codec->codec_id != CODEC_ID_NONE && score > AVPROBE_SCORE_MAX/4-1)
                     || end){
                     pd->buf_size=0;
                     av_freep(&pd->buf);
-- 
1.7.9.4

