changeset 4717:b7054dadd2c0

We should skip exactly the first frame on mp3 files. Should correct many badly detected file, decoder crash, etc
author albeu
date Fri, 15 Feb 2002 16:48:25 +0000
parents 0533513f835c
children c70b0c4b85f5
files libmpdemux/demux_audio.c
diffstat 1 files changed, 2 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_audio.c	Fri Feb 15 13:14:41 2002 +0000
+++ b/libmpdemux/demux_audio.c	Fri Feb 15 16:48:25 2002 +0000
@@ -66,7 +66,7 @@
     } else if( hdr[0] == 'f' && hdr[1] == 'm' && hdr[2] == 't' && hdr[3] == ' ' ) {
       frmt = WAV;
       break;      
-    } else if(mp_decode_mp3_header(hdr) > 0) {
+    } else if((n = mp_decode_mp3_header(hdr)) > 0) {
       frmt = MP3;
       break;
     }
@@ -84,7 +84,7 @@
   switch(frmt) {
   case MP3:
     sh_audio->format = 0x55;
-    demuxer->movi_start = st_pos-3;
+    demuxer->movi_start = st_pos-HDR_SIZE+n;
     for(n = 0; n < 5 ; n++) {
       pos = mp_decode_mp3_header(hdr);
       if(pos < 0)
@@ -160,7 +160,6 @@
   priv = (da_priv_t*)malloc(sizeof(da_priv_t));
   priv->frmt = frmt;
   demuxer->priv = priv;
-//  demuxer->movi_start = st_pos;
   demuxer->audio->id = 0;
   demuxer->audio->sh = sh_audio;
   sh_audio->ds = demuxer->audio;