diff options
author | James Stembridge <jstembridge@users.sourceforge.net> | 2003-10-27 22:26:03 +0000 |
---|---|---|
committer | James Stembridge <jstembridge@users.sourceforge.net> | 2003-10-27 22:26:03 +0000 |
commit | 82d1557e51e3d361a1d420c51feace0314b86da8 (patch) | |
tree | e4effcf0e382264a7d7522c4e9a18461dfc842dc /src | |
parent | 289406c7594c1aba6b637123e539716d2eb53ee5 (diff) | |
download | xine-lib-82d1557e51e3d361a1d420c51feace0314b86da8.tar.gz xine-lib-82d1557e51e3d361a1d420c51feace0314b86da8.tar.bz2 |
Fix aspect ratio problem
CVS patchset: 5621
CVS date: 2003/10/27 22:26:03
Diffstat (limited to 'src')
-rw-r--r-- | src/libffmpeg/xine_decoder.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/libffmpeg/xine_decoder.c b/src/libffmpeg/xine_decoder.c index b704734ba..0ec30a994 100644 --- a/src/libffmpeg/xine_decoder.c +++ b/src/libffmpeg/xine_decoder.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: xine_decoder.c,v 1.131 2003/10/27 15:24:38 tmmm Exp $ + * $Id: xine_decoder.c,v 1.132 2003/10/27 22:26:03 jstembridge Exp $ * * xine decoder plugin using ffmpeg * @@ -99,7 +99,7 @@ struct ff_video_decoder_s { int is_continous; - float aspect_ratio; + double aspect_ratio; int frame_flags; int output_format; @@ -165,7 +165,7 @@ static int get_buffer(AVCodecContext *context, AVFrame *av_frame){ img = this->stream->video_out->get_frame (this->stream->video_out, width, height, - (double)this->aspect_ratio, + this->aspect_ratio, this->output_format, VO_BOTH_FIELDS|this->frame_flags); @@ -1072,7 +1072,9 @@ static void ff_decode_data (video_decoder_t *this_gen, buf_element_t *buf) { printf ("ffmpeg: got a picture\n"); #endif - this->aspect_ratio = av_q2d (this->context->sample_aspect_ratio); + this->aspect_ratio = av_q2d(this->context->sample_aspect_ratio) * + (double) this->context->width / (double) this->context->height; + if(this->av_frame->type == FF_BUFFER_TYPE_USER){ img = (vo_frame_t*)this->av_frame->opaque; @@ -1081,7 +1083,7 @@ static void ff_decode_data (video_decoder_t *this_gen, buf_element_t *buf) { img = this->stream->video_out->get_frame (this->stream->video_out, this->context->width, this->context->height, - (double)this->aspect_ratio, + this->aspect_ratio, this->output_format, VO_BOTH_FIELDS|this->frame_flags); free_img = 1; @@ -1106,7 +1108,7 @@ static void ff_decode_data (video_decoder_t *this_gen, buf_element_t *buf) { img = this->stream->video_out->get_frame (this->stream->video_out, img->width, img->height, - (double)this->aspect_ratio, + this->aspect_ratio, this->output_format, VO_BOTH_FIELDS|this->frame_flags); free_img = 1; |