summaryrefslogtreecommitdiffstats
path: root/libhb/stream.c
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2014-09-09 14:32:26 +0000
committerjstebbins <[email protected]>2014-09-09 14:32:26 +0000
commit54dbf9c1dea56d271b1760e7f6b085914b0cff7c (patch)
tree926702a322267e7cf6b11c08131d0a21b673da65 /libhb/stream.c
parenta2572742cad5e1156fdd8d2c0050f2c675e02670 (diff)
libhb: fix scanning of video that is a single GOP
With this type of stream, scan only successfully decodes 1 frame. Eliminating the flush after seek allows decoding more frames. Note that there is a side effect of allowing some junk frames to be decoded, so we only skip the flush if normal scanning finds only 1 frame. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6396 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/stream.c')
-rw-r--r--libhb/stream.c20
1 files changed, 5 insertions, 15 deletions
diff --git a/libhb/stream.c b/libhb/stream.c
index 05f1e9fc9..5b59c44db 100644
--- a/libhb/stream.c
+++ b/libhb/stream.c
@@ -3460,8 +3460,8 @@ static hb_buffer_t * hb_ps_stream_decode( hb_stream_t *stream )
!isIframe( stream, buf->data, buf->size ) )
{
// not the video stream or didn't find an I frame
- // but we'll only wait 255 video frames for an I frame.
- if ( buf->s.type != VIDEO_BUF || ++stream->need_keyframe < 512 )
+ // but we'll only wait 600 video frames for an I frame.
+ if ( buf->s.type != VIDEO_BUF || ++stream->need_keyframe < 600 )
{
continue;
}
@@ -4889,21 +4889,11 @@ static hb_buffer_t * hb_ts_stream_decode( hb_stream_t *stream )
void hb_stream_set_need_keyframe(hb_stream_t *stream, int need_keyframe)
{
- if ( stream->hb_stream_type == transport )
+ if ( stream->hb_stream_type == transport ||
+ stream->hb_stream_type == program )
{
// Only wait for a keyframe if the stream is known to have IDRs
- if ( stream->has_IDRs )
- {
- stream->need_keyframe = need_keyframe;
- }
- }
- else if ( stream->hb_stream_type == program )
- {
- // Only wait for a keyframe if the stream is known to have IDRs
- if ( stream->has_IDRs )
- {
- stream->need_keyframe = need_keyframe;
- }
+ stream->need_keyframe = !!need_keyframe & !!stream->has_IDRs;
}
else
{