We should skip exactly the first frame on mp3 files.

Should correct many badly detected file, decoder crash, etc


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4718 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
albeu 2002-02-15 16:48:25 +00:00
parent 46ef333c2f
commit 668ec5553c
1 changed files with 2 additions and 3 deletions

View File

@ -66,7 +66,7 @@ int demux_audio_open(demuxer_t* demuxer) {
} else if( hdr[0] == 'f' && hdr[1] == 'm' && hdr[2] == 't' && hdr[3] == ' ' ) { } else if( hdr[0] == 'f' && hdr[1] == 'm' && hdr[2] == 't' && hdr[3] == ' ' ) {
frmt = WAV; frmt = WAV;
break; break;
} else if(mp_decode_mp3_header(hdr) > 0) { } else if((n = mp_decode_mp3_header(hdr)) > 0) {
frmt = MP3; frmt = MP3;
break; break;
} }
@ -84,7 +84,7 @@ int demux_audio_open(demuxer_t* demuxer) {
switch(frmt) { switch(frmt) {
case MP3: case MP3:
sh_audio->format = 0x55; sh_audio->format = 0x55;
demuxer->movi_start = st_pos-3; demuxer->movi_start = st_pos-HDR_SIZE+n;
for(n = 0; n < 5 ; n++) { for(n = 0; n < 5 ; n++) {
pos = mp_decode_mp3_header(hdr); pos = mp_decode_mp3_header(hdr);
if(pos < 0) if(pos < 0)
@ -160,7 +160,6 @@ int demux_audio_open(demuxer_t* demuxer) {
priv = (da_priv_t*)malloc(sizeof(da_priv_t)); priv = (da_priv_t*)malloc(sizeof(da_priv_t));
priv->frmt = frmt; priv->frmt = frmt;
demuxer->priv = priv; demuxer->priv = priv;
// demuxer->movi_start = st_pos;
demuxer->audio->id = 0; demuxer->audio->id = 0;
demuxer->audio->sh = sh_audio; demuxer->audio->sh = sh_audio;
sh_audio->ds = demuxer->audio; sh_audio->ds = demuxer->audio;