return buf;
}
+static int get_frame_type(int type)
+{
+ switch(type)
+ {
+ case AV_PICTURE_TYPE_I:
+ return HB_FRAME_I;
+ case AV_PICTURE_TYPE_B:
+ return HB_FRAME_B;
+ case AV_PICTURE_TYPE_P:
+ return HB_FRAME_P;
+ }
+ return 0;
+}
+
/*
* Decodes a video frame from the specified raw packet data
* ('data', 'size', 'sequence').
{
flags |= PIC_FLAG_REPEAT_FRAME;
}
+ int frametype = get_frame_type(pv->frame->pict_type);
// Check for CC data
AVFrameSideData *sd;
buf->sequence = sequence;
buf->s.flags = flags;
+ buf->s.frametype = frametype;
if ( pv->new_chap && buf->s.start >= pv->chap_time )
{
buf->sequence = sequence;
/* Store picture flags for later use by filters */
buf->s.flags = flags;
+ buf->s.frametype = frametype;
pv->delayq[slot] = buf;
heap_push( &pv->pts_heap, pts );
// Set encoder opts...
AVDictionary * av_opts = NULL;
av_dict_set( &av_opts, "refcounted_frames", "1", 0 );
+ if (pv->title->flags & HBTF_NO_IDR)
+ {
+ av_dict_set( &av_opts, "flags", "output_corrupt", 0 );
+ }
if ( hb_avcodec_open( pv->context, codec, &av_opts, pv->threads ) )
{
AVDictionary * av_opts = NULL;
av_dict_set( &av_opts, "refcounted_frames", "1", 0 );
+ if (pv->title->flags & HBTF_NO_IDR)
+ {
+ av_dict_set( &av_opts, "flags", "output_corrupt", 0 );
+ }
// disable threaded decoding for scan, can cause crashes
if ( hb_avcodec_open( pv->context, codec, &av_opts, pv->threads ) )
int pulldown_count = 0;
int doubled_frame_count = 0;
int interlaced_preview_count = 0;
+ int frame_wait = 0;
hb_stream_t * stream = NULL;
info_list_t * info_list = calloc( data->preview_count+1, sizeof(*info_list) );
crop_record_t *crops = crop_record_init( data->preview_count );
if (flush && vid_decoder->flush)
vid_decoder->flush( vid_decoder );
+ if (title->flags & HBTF_NO_IDR)
+ {
+ frame_wait = 100;
+ }
hb_buffer_t * vid_buf = NULL;
if( buf_es->s.id == title->video_id && vid_buf == NULL )
{
vid_decoder->work( vid_decoder, &buf_es, &vid_buf );
+ if (vid_buf != NULL && frame_wait)
+ {
+ if (vid_buf->s.frametype != HB_FRAME_I)
+ {
+ hb_buffer_close(&vid_buf);
+ frame_wait--;
+ }
+ else
+ {
+ frame_wait = 0;
+ }
+ }
}
else if( ! AllAudioOK( title ) )
{
chapter->seconds = title->seconds;
hb_list_add( title->list_chapter, chapter );
-
if ( stream->has_IDRs < 1 )
{
hb_log( "stream doesn't seem to have video IDR frames" );
title->pixel_aspect_height = ic->streams[i]->sample_aspect_ratio.den;
}
- if ( context->codec_id == AV_CODEC_ID_H264 )
- title->flags |= HBTF_NO_IDR;
-
title->video_codec = WORK_DECAVCODECV;
title->video_codec_param = context->codec_id;
}