Skip to content

Commit

Permalink
CMp3Enc::gen_vbr_table: Ensure a valid bitrate index if a too low VBR…
Browse files Browse the repository at this point in the history
… bitrate limit is specified
  • Loading branch information
maikmerten committed May 25, 2024
1 parent f2a0dc1 commit 9850021
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions hmp3/src/mp3enc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -986,7 +986,7 @@ CMp3Enc::gen_vbr_table ( int h_mode, int samplerate, int max_tot_bitrate )
vbr_main_framebytes[15] = 9999999;

vbr_pool_target = 256; // use more pool with restricted br
for ( i = 14; i >= 1; i-- )
for ( i = 14; i >= 2; i-- )
{
if ( max_tot_bitrate >= vbr_br_table[i] )
break;
Expand Down Expand Up @@ -1022,7 +1022,7 @@ CMp3Enc::gen_vbr_table ( int h_mode, int samplerate, int max_tot_bitrate )
vbr_main_framebytes[15] = 9999999;

vbr_pool_target = 128; // use more pool with restricted br
for ( i = 14; i >= 1; i-- )
for ( i = 14; i >= 2; i-- )
{
if ( max_tot_bitrate >= vbr_br_tableMPEG2[i] )
break;
Expand Down

0 comments on commit 9850021

Please sign in to comment.