picref->pts = pts;
picref->pos = pkt.pos;
- picref->video->pixel_aspect = priv->is->video_st->codec->sample_aspect_ratio;
+ picref->video->pixel_aspect = priv->frame->sample_aspect_ratio;
avfilter_start_frame(link, picref);
avfilter_draw_slice(link, 0, link->h, 1);
avfilter_end_frame(link);
frame->top_field_first = picref->video->top_field_first;
frame->key_frame = picref->video->key_frame;
frame->pict_type = picref->video->pict_type;
+ frame->sample_aspect_ratio = picref->video->pixel_aspect;
return 1;
}
* decoding: set by AVCodecContext.get_buffer()
*/
uint8_t **extended_data;
+
+ /**
+ * sample aspect ratio for the video frame, 0/1 if unknown\unspecified
+ * - encoding: unused
+ * - decoding: Read by user.
+ */
+ AVRational sample_aspect_ratio;
} AVFrame;
struct AVCodecInternal;
*picture = p->frame;
*got_picture_ptr = p->got_frame;
picture->pkt_dts = p->avpkt.dts;
+ picture->sample_aspect_ratio = avctx->sample_aspect_ratio;
/*
* A later call with avkpt->size == 0 may loop over all threads,
pic->pts= AV_NOPTS_VALUE;
pic->key_frame= 1;
+ pic->sample_aspect_ratio = (AVRational){0, 1};
}
AVFrame *avcodec_alloc_frame(void){
ret = avctx->codec->decode(avctx, picture, got_picture_ptr,
avpkt);
picture->pkt_dts= avpkt->dts;
+ picture->sample_aspect_ratio = avctx->sample_aspect_ratio;
}
emms_c(); //needed to avoid an emms_c() call before every return;
movie->frame->pkt_dts : movie->frame->pkt_pts;
movie->picref->pos = movie->frame->reordered_opaque;
- movie->picref->video->pixel_aspect = st->sample_aspect_ratio.num ?
- st->sample_aspect_ratio : movie->codec_ctx->sample_aspect_ratio;
+ if (!movie->frame->sample_aspect_ratio.num)
+ movie->picref->video->pixel_aspect = st->sample_aspect_ratio;
movie->picref->video->interlaced = movie->frame->interlaced_frame;
movie->picref->video->top_field_first = movie->frame->top_field_first;
movie->picref->video->key_frame = movie->frame->key_frame;