summaryrefslogtreecommitdiffstats
path: root/libmpdemux
diff options
context:
space:
mode:
authornicodvb <nicodvb@b3059339-0415-0410-9bf9-f77b7e298cf2>2005-04-09 11:00:00 +0000
committernicodvb <nicodvb@b3059339-0415-0410-9bf9-f77b7e298cf2>2005-04-09 11:00:00 +0000
commitf1a9cf6c699848181fb72c51106d2d5a2d2192b6 (patch)
tree23520b399558d52c64bb63bf34f9288a35c94fb9 /libmpdemux
parent3095df2c6ae78dafee878de8b3a769a0cda827df (diff)
downloadmpv-f1a9cf6c699848181fb72c51106d2d5a2d2192b6.tar.bz2
mpv-f1a9cf6c699848181fb72c51106d2d5a2d2192b6.tar.xz
assign picture->(width,height) when parsing h264
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@15074 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux')
-rw-r--r--libmpdemux/mpeg_hdr.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/libmpdemux/mpeg_hdr.c b/libmpdemux/mpeg_hdr.c
index 5174b59bd8..c8867d4ea0 100644
--- a/libmpdemux/mpeg_hdr.c
+++ b/libmpdemux/mpeg_hdr.c
@@ -297,8 +297,9 @@ static int h264_parse_vui(mp_mpeg_header_t * picture, unsigned char * buf, unsig
int h264_parse_sps(mp_mpeg_header_t * picture, unsigned char * buf, int len)
{
- unsigned int n = 0, m = 0, v, i, j;
+ unsigned int n = 0, v, i, j, mbh;
unsigned char *dest;
+ int frame_mbs_only;
dest = (unsigned char*) malloc(len);
if(! dest)
@@ -343,9 +344,11 @@ int h264_parse_sps(mp_mpeg_header_t * picture, unsigned char * buf, int len)
}
read_golomb(buf, &n);
getbits(buf, n++, 1);
- read_golomb(buf, &n);
- read_golomb(buf, &n);
- if(!getbits(buf, n++, 1))
+ picture->display_picture_width = 16 *(read_golomb(buf, &n)+1);
+ mbh = read_golomb(buf, &n)+1;
+ frame_mbs_only = getbits(buf, n++, 1);
+ picture->display_picture_height = 16 * (2 - frame_mbs_only) * mbh;
+ if(!frame_mbs_only)
getbits(buf, n++, 1);
getbits(buf, n++, 1);
if(getbits(buf, n++, 1))