From 5a5d4c946eff018501fdd017b81b7db68d2cef28 Mon Sep 17 00:00:00 2001 From: reimar Date: Mon, 18 Apr 2005 20:51:34 +0000 Subject: Fix MP3 detection (list of found MP3 headers was not kep sorted). Also remove code that only fixed the symptoms. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@15216 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpdemux/demux_audio.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libmpdemux/demux_audio.c b/libmpdemux/demux_audio.c index 9b6be0e36e..79c8a0acc3 100644 --- a/libmpdemux/demux_audio.c +++ b/libmpdemux/demux_audio.c @@ -101,6 +101,9 @@ static mp3_hdr_t *add_mp3_hdr(mp3_hdr_t **list, off_t st_pos, } } if (!in_list) { // does not belong into an existing chain, insert + // find right position to insert to keep sorting + while (*list && (*list)->next_frame_pos <= st_pos + mp3_flen) + list = &((*list)->next); tmp = malloc(sizeof(mp3_hdr_t)); tmp->frame_pos = st_pos; tmp->next_frame_pos = st_pos + mp3_flen; @@ -158,8 +161,6 @@ int demux_audio_open(demuxer_t* demuxer) { frmt = WAV; break; } else if((mp3_flen = mp_get_mp3_header(hdr,&mp3_chans,&mp3_freq,&mpa_spf,&mpa_layer)) > 0) { - stream_skip(s, mp3_flen - HDR_SIZE); - step = HDR_SIZE; mp3_found = add_mp3_hdr(&mp3_hdrs, st_pos, mp3_chans, mp3_freq, mp3_flen); if (mp3_found) { frmt = MP3; -- cgit v1.2.3