diff options
author | Guenter Bartsch <guenter@users.sourceforge.net> | 2001-04-20 18:01:30 +0000 |
---|---|---|
committer | Guenter Bartsch <guenter@users.sourceforge.net> | 2001-04-20 18:01:30 +0000 |
commit | 9906645c4669be8476c683b7dfcf321b99ac15a1 (patch) | |
tree | b14c4c012b200f1cbe9f6dfbb2c39b5d1120b296 /src/libmpeg2/header.c | |
parent | 427f43f1cb7c7c68aeab0dc0a06dbded6bb3a8e3 (diff) | |
download | xine-lib-9906645c4669be8476c683b7dfcf321b99ac15a1.tar.gz xine-lib-9906645c4669be8476c683b7dfcf321b99ac15a1.tar.bz2 |
libmpeg2 compiles again
CVS patchset: 10
CVS date: 2001/04/20 18:01:30
Diffstat (limited to 'src/libmpeg2/header.c')
-rw-r--r-- | src/libmpeg2/header.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/libmpeg2/header.c b/src/libmpeg2/header.c index e021b2f8e..013393da4 100644 --- a/src/libmpeg2/header.c +++ b/src/libmpeg2/header.c @@ -22,6 +22,7 @@ #include "config.h" #include <inttypes.h> +#include <stdio.h> #include "mpeg2_internal.h" #include "attributes.h" @@ -94,6 +95,39 @@ int header_process_sequence_header (picture_t * picture, uint8_t * buffer) /* this is not used by the decoder */ picture->aspect_ratio_information = buffer[3] >> 4; picture->frame_rate_code = buffer[3] & 15; + + switch (picture->frame_rate_code) { + case 1: /* 23.976 fps */ + picture->frame_duration = 3913; + break; + case 2: /* 24 fps */ + picture->frame_duration = 3750; + break; + case 3: /* 25 fps */ + picture->frame_duration = 3600; + break; + case 4: /* 29.97 fps */ + picture->frame_duration = 3003; + break; + case 5: /* 30 fps */ + picture->frame_duration = 3000; + break; + case 6: /* 50 fps */ + picture->frame_duration = 1800; + break; + case 7: /* 59.94 fps */ + picture->frame_duration = 1525; + break; + case 8: /* 60 fps */ + picture->frame_duration = 1509; + break; + default: + printf ("invalid/unknown frame rate code : %d \n", + picture->frame_rate_code); + picture->frame_duration = 3000; + } + + picture->bitrate = (buffer[4]<<10)|(buffer[5]<<2)|(buffer[6]>>6); if (buffer[7] & 2) { |