mirror of
https://github.com/mpv-player/mpv
synced 2025-02-20 14:56:55 +00:00
moved code to set aspect ratio for mpeg12 away from video.c and into decoder files; A/R changes work correctly with -vc mpeg12
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@18429 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
cef8c72bae
commit
7c516063da
@ -157,6 +157,7 @@ static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags){
|
||||
int state=mpeg2_parse (mpeg2dec);
|
||||
int type, use_callback;
|
||||
mp_image_t* mpi_new;
|
||||
unsigned long pw, ph;
|
||||
|
||||
switch(state){
|
||||
case STATE_BUFFER:
|
||||
@ -170,6 +171,9 @@ static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags){
|
||||
}
|
||||
break;
|
||||
case STATE_SEQUENCE:
|
||||
pw = info->sequence->display_width * info->sequence->pixel_width;
|
||||
ph = info->sequence->display_height * info->sequence->pixel_height;
|
||||
if(ph) sh->aspect = (float) pw / (float) ph;
|
||||
// video parameters inited/changed, (re)init libvo:
|
||||
if (info->sequence->width >> 1 == info->sequence->chroma_width &&
|
||||
info->sequence->height >> 1 == info->sequence->chroma_height) {
|
||||
|
@ -326,7 +326,6 @@ mpeg_header_parser:
|
||||
}
|
||||
|
||||
// printf("picture.fps=%d\n",picture.fps);
|
||||
sh_video->aspect = mpeg12_aspect_info(&picture);
|
||||
// display info:
|
||||
sh_video->format=picture.mpeg1?0x10000001:0x10000002; // mpeg video
|
||||
sh_video->fps=picture.fps;
|
||||
|
Loading…
Reference in New Issue
Block a user