diff options
author | jstebbins <[email protected]> | 2010-10-09 01:51:28 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2010-10-09 01:51:28 +0000 |
commit | cee54f9f9792d19c19192dcb3699e477fb950ae0 (patch) | |
tree | f040444b6b68ad1aae88ec74ee8c36ca1f8cf73a /libhb/muxmp4.c | |
parent | 29c481714320b4776a564289d344319758b18901 (diff) |
fix detection of sr_code and bitrate_code for ac3 streams in mp4
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3586 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/muxmp4.c')
-rw-r--r-- | libhb/muxmp4.c | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/libhb/muxmp4.c b/libhb/muxmp4.c index 5225ea523..6fdf7899f 100644 --- a/libhb/muxmp4.c +++ b/libhb/muxmp4.c @@ -251,20 +251,18 @@ static int MP4Init( hb_mux_object_t * m ) { if ((ac3_sample_rate_tab[jj] >> ii) == freq) { - break; + goto rate_found1; } } } - if ( ii >= 3 ) - { - hb_error("Unknown AC3 samplerate"); - ii = jj = 0; - } + hb_error("Unknown AC3 samplerate"); + ii = jj = 0; +rate_found1: sr_shift = ii; sr_code = jj; for (ii = 0; ii < 19; ii++) { - if ((ac3_bitrate_tab[ii] >> sr_shift)*1000 == bitrate) + if ((ac3_bitrate_tab[ii] >> sr_shift) == bitrate) break; } if ( ii >= 19 ) @@ -319,21 +317,19 @@ static int MP4Init( hb_mux_object_t * m ) { if ((ac3_sample_rate_tab[jj] >> ii) == freq) { - break; + goto rate_found2; } } } - if ( ii >= 3 ) - { - hb_error("Unknown AC3 samplerate"); - ii = jj = 0; - } + hb_error("Unknown AC3 samplerate"); + ii = jj = 0; +rate_found2: sr_shift = ii; sr_code = jj; bsid = 8 + ii; for (ii = 0; ii < 19; ii++) { - if ((ac3_bitrate_tab[ii] >> sr_shift)*1000 == bitrate) + if ((ac3_bitrate_tab[ii] >> sr_shift) == bitrate) break; } if ( ii >= 19 ) |