|
|
|
@ -69,6 +69,7 @@ typedef struct Mpeg1Context { |
|
|
|
|
int rc_buffer_size; |
|
|
|
|
AVRational frame_rate_ext; /* MPEG-2 specific framerate modificator */ |
|
|
|
|
int sync; /* Did we reach a sync point like a GOP/SEQ/KEYFrame? */ |
|
|
|
|
int closed_gop; |
|
|
|
|
int tmpgexs; |
|
|
|
|
int first_slice; |
|
|
|
|
int extradata_decoded; |
|
|
|
@ -2449,7 +2450,7 @@ static void mpeg_decode_gop(AVCodecContext *avctx, |
|
|
|
|
|
|
|
|
|
tc = s-> timecode_frame_start = get_bits(&s->gb, 25); |
|
|
|
|
|
|
|
|
|
s->closed_gop = get_bits1(&s->gb); |
|
|
|
|
s1->closed_gop = get_bits1(&s->gb); |
|
|
|
|
/* broken_link indicates that after editing the
|
|
|
|
|
* reference frames of the first B-Frames after GOP I-Frame |
|
|
|
|
* are missing (open gop) */ |
|
|
|
@ -2460,7 +2461,7 @@ static void mpeg_decode_gop(AVCodecContext *avctx, |
|
|
|
|
av_timecode_make_mpeg_tc_string(tcbuf, tc); |
|
|
|
|
av_log(s->avctx, AV_LOG_DEBUG, |
|
|
|
|
"GOP (%s) closed_gop=%d broken_link=%d\n", |
|
|
|
|
tcbuf, s->closed_gop, broken_link); |
|
|
|
|
tcbuf, s1->closed_gop, broken_link); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -2694,7 +2695,7 @@ static int decode_chunks(AVCodecContext *avctx, AVFrame *picture, |
|
|
|
|
/* Skip B-frames if we do not have reference frames and
|
|
|
|
|
* GOP is not closed. */ |
|
|
|
|
if (s2->pict_type == AV_PICTURE_TYPE_B) { |
|
|
|
|
if (!s2->closed_gop) { |
|
|
|
|
if (!s->closed_gop) { |
|
|
|
|
skip_frame = 1; |
|
|
|
|
av_log(s2->avctx, AV_LOG_DEBUG, |
|
|
|
|
"Skipping B slice due to open GOP\n"); |
|
|
|
@ -2882,6 +2883,7 @@ static void flush(AVCodecContext *avctx) |
|
|
|
|
Mpeg1Context *s = avctx->priv_data; |
|
|
|
|
|
|
|
|
|
s->sync = 0; |
|
|
|
|
s->closed_gop = 0; |
|
|
|
|
|
|
|
|
|
ff_mpeg_flush(avctx); |
|
|
|
|
} |
|
|
|
|