diff options
author | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2011-04-29 13:04:47 +0200 |
---|---|---|
committer | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2011-05-01 13:10:06 +0200 |
commit | 77e9dee8aefa3fca75984226f66bf004bb8f9e13 (patch) | |
tree | cd9590685f22841807a08105948faa115a6a31b1 /ffmpeg.c | |
parent | 1ba57272429fc6c86e39cd236e2b32ac545e1488 (diff) | |
download | ffmpeg-77e9dee8aefa3fca75984226f66bf004bb8f9e13.tar.gz |
lavc: add a sample_aspect_ratio field to AVFrame
The sample aspect ratio is a per-frame property, so it makes sense to
define it in AVFrame rather than in the codec/stream context.
Simplify application-level sample aspect ratio information extraction,
and allow further simplifications.
Diffstat (limited to 'ffmpeg.c')
-rw-r--r-- | ffmpeg.c | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -1631,13 +1631,12 @@ static int output_packet(AVInputStream *ist, int ist_index, for(i=0;i<nb_ostreams;i++) { ost = ost_table[i]; if (ost->input_video_filter && ost->source_index == ist_index) { - AVRational sar; - if (ist->st->sample_aspect_ratio.num) sar = ist->st->sample_aspect_ratio; - else sar = ist->st->codec->sample_aspect_ratio; + if (!picture.sample_aspect_ratio.num) + picture.sample_aspect_ratio = ist->st->sample_aspect_ratio; // add it to be filtered av_vsrc_buffer_add_frame2(ost->input_video_filter, &picture, ist->pts, - sar, ist->st->codec->width, ist->st->codec->height, + ist->st->codec->width, ist->st->codec->height, ist->st->codec->pix_fmt, ""); //TODO user setable params } } |