Mercurial > mplayer.hg
changeset 4711:39f5eccd54c2
added mp3 detection
author | arpi |
---|---|
date | Thu, 14 Feb 2002 23:41:34 +0000 |
parents | 701976d7a7d1 |
children | 9262f4dc332f |
files | libmpdemux/demux_mpg.c |
diffstat | 1 files changed, 9 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/libmpdemux/demux_mpg.c Thu Feb 14 23:41:00 2002 +0000 +++ b/libmpdemux/demux_mpg.c Thu Feb 14 23:41:34 2002 +0000 @@ -12,6 +12,7 @@ #include "demuxer.h" #include "parse_es.h" #include "stheader.h" +#include "mp3_hdr.h" #include "dvdauth.h" @@ -238,6 +239,7 @@ int num_elementary_packets101=0; int num_elementary_packets1B6=0; int num_elementary_packetsPES=0; +int num_mp3audio_packets=0; int demux_mpg_es_fill_buffer(demuxer_t *demux){ // Elementary video stream @@ -266,6 +268,7 @@ head<<=8; if(head!=0x100){ head|=c; + if(mp_check_mp3_header(head)) ++num_mp3audio_packets; ++skipped; //++demux->filepos; continue; } @@ -304,7 +307,7 @@ if(head==0x101) ++num_elementary_packets101; mp_msg(MSGT_DEMUX,MSGL_DBG3,"Opps... elementary video packet found: %03X\n",head); } else - if(head>=0x1C0 && head<0x1F0){ + if((head>=0x1C0 && head<0x1F0) || head==0x1BD){ ++num_elementary_packetsPES; mp_msg(MSGT_DEMUX,MSGL_DBG3,"Opps... PES packet found: %03X\n",head); } else @@ -316,6 +319,11 @@ demux->stream->eof=1; break; } + if(num_mp3audio_packets>100 && num_elementary_packets100<10){ + mp_msg(MSGT_DEMUX,MSGL_V,"sync_mpeg_ps: seems to be MP3 stream...\n"); + demux->stream->eof=1; + break; + } #endif } } while(ret!=1);