mpeg4videoparse: fix number of bytes read for fixed time increment

The spec I found says "16 bits".
The existing code used log2(somevalue)+1.
ffmpeg uses log2(somevalue-1)+1.
The code now uses log2(somevalue-1)+1, and this makes it work with
some sample video without breaking another sample.
Now, I'm far from certain I've got the right spec, I found it by
searching the internet, so...

https://bugzilla.gnome.org/show_bug.cgi?id=654666
This commit is contained in:
Vincent Penquerc'h 2011-08-18 11:39:37 +01:00
parent f1a4791f74
commit 4735a7554b

View file

@ -164,8 +164,8 @@ gst_mpeg4_params_parse_vo (MPEG4Params * params, GstBitReader * br)
int n;
/* Length of the time increment is the minimal number of bits needed to
* represent time_increment_resolution */
for (n = 0; (time_increment_resolution >> n) != 0; n++);
* represent time_increment_resolution-1 */
for (n = 0; ((time_increment_resolution - 1) >> n) != 0; n++);
GET_BITS (br, n, &bits);
fixed_time_increment = bits;