mirror of
https://github.com/schnaader/precomp-cpp
synced 2026-08-23 00:23:04 -04:00
Only allow MPEG-1, Layer III as first frame
This prevents passing the frames to packMP3 for each frame which slows down the process for non-MPEG-1, Layer III MP3s
This commit is contained in:
parent
0bc525232a
commit
ff680417db
1 changed files with 5 additions and 1 deletions
|
|
@ -125,6 +125,7 @@ const char* pjglib_version_info( void );
|
|||
|
||||
//PackMP3 things
|
||||
|
||||
#include "contrib/packjpg/bitops.h" // for MBITS
|
||||
#include "contrib/packmp3/pmp3tbl.h"
|
||||
|
||||
// function to convert MP3 to PMP and vice versa
|
||||
|
|
@ -4052,7 +4053,10 @@ bool compress_file(float min_percent, float max_percent) {
|
|||
protection = (in[1] >> 0) & 0x1;
|
||||
samples = (in[2] >> 2) & 0x3;
|
||||
channels = (in[3] >> 6) & 0x3;
|
||||
} else if (
|
||||
// type must be MPEG-1, Layer III, packMP3 won't process any other files
|
||||
int type = MBITS( in[1], 5, 1 );
|
||||
if ( type != MPEG1_LAYER_III ) break;
|
||||
} else if (
|
||||
(mpeg != ((in[1] >> 3) & 0x3)) ||
|
||||
(layer != ((in[1] >> 1) & 0x3)) ||
|
||||
(protection != ((in[1] >> 0) & 0x1)) ||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue