[FFmpeg-cvslog] avplay: apply the stream sample_aspect_ratio to decoded video frames
Vladimir Pantelic
git at videolan.org
Sun Feb 10 12:52:51 CET 2013
ffmpeg | branch: master | Vladimir Pantelic <vladoman at gmail.com> | Thu Feb 7 18:42:39 2013 +0100| [db0a943266be29ff0596872ebb418dfed75d00de] | committer: Anton Khirnov
avplay: apply the stream sample_aspect_ratio to decoded video frames
If there is a sample_aspect_ratio in the stream, then apply it to every
decoded frame in the same way as avconv does. This also makes sure that
the avfilter chain has access to the aspect ratio.
Signed-off-by: Vladimir Pantelic <vladoman at gmail.com>
Signed-off-by: Anton Khirnov <anton at khirnov.net>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=db0a943266be29ff0596872ebb418dfed75d00de
---
avplay.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/avplay.c b/avplay.c
index 3e2110f..c45ec55 100644
--- a/avplay.c
+++ b/avplay.c
@@ -1495,6 +1495,9 @@ static int get_video_frame(VideoState *is, AVFrame *frame, int64_t *pts, AVPacke
if (*pts == AV_NOPTS_VALUE) {
*pts = 0;
}
+ if (is->video_st->sample_aspect_ratio.num) {
+ frame->sample_aspect_ratio = is->video_st->sample_aspect_ratio;
+ }
is->skip_frames_index += 1;
if (is->skip_frames_index >= is->skip_frames) {
More information about the ffmpeg-cvslog
mailing list