if (avctx->codec->type == AVMEDIA_TYPE_VIDEO) {
if (frame->flags & AV_FRAME_FLAG_DISCARD)
got_frame = 0;
- if (got_frame)
- frame->best_effort_timestamp = guess_correct_pts(avctx,
- frame->pts,
- frame->pkt_dts);
} else if (avctx->codec->type == AVMEDIA_TYPE_AUDIO) {
uint8_t *side;
int side_size;
uint8_t discard_reason = 0;
if (ret >= 0 && got_frame) {
- frame->best_effort_timestamp = guess_correct_pts(avctx,
- frame->pts,
- frame->pkt_dts);
if (frame->format == AV_SAMPLE_FMT_NONE)
frame->format = avctx->sample_fmt;
if (!frame->channel_layout)
avci->draining_done = 1;
if (!ret) {
+ frame->best_effort_timestamp = guess_correct_pts(avctx,
+ frame->pts,
+ frame->pkt_dts);
+
/* the only case where decode data is not set should be decoders
* that do not call ff_get_buffer() */
av_assert0((frame->private_ref && frame->private_ref->size == sizeof(FrameDecodeData)) ||