diff options
author | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2005-04-18 20:51:34 +0000 |
---|---|---|
committer | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2005-04-18 20:51:34 +0000 |
commit | 5a5d4c946eff018501fdd017b81b7db68d2cef28 (patch) | |
tree | 6b345e714b6a466e2479d42335323034d752bdfb /libmpdemux | |
parent | 88f440321bd266511775f9527a9dbdc3c705742a (diff) | |
download | mpv-5a5d4c946eff018501fdd017b81b7db68d2cef28.tar.bz2 mpv-5a5d4c946eff018501fdd017b81b7db68d2cef28.tar.xz |
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
Diffstat (limited to 'libmpdemux')
-rw-r--r-- | libmpdemux/demux_audio.c | 5 |
1 files 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; |