summaryrefslogtreecommitdiffstats
path: root/libmpdemux
diff options
context:
space:
mode:
authorrtogni <rtogni@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-08-11 22:57:33 +0000
committerrtogni <rtogni@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-08-11 22:57:33 +0000
commit1c4b71edd95611ef059aea9a26901bc7df1bd25b (patch)
tree629b12be18b6a26192b85dc94eea1e058abed012 /libmpdemux
parent51d4c3244629d82f44cf44073de306cfc18c19e9 (diff)
downloadmpv-1c4b71edd95611ef059aea9a26901bc7df1bd25b.tar.bz2
mpv-1c4b71edd95611ef059aea9a26901bc7df1bd25b.tar.xz
Add support for 13k Voice (Qclp) in 3g2 files
Fix vorbis detection so that it doesn't misdetect other codecs git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19369 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux')
-rw-r--r--libmpdemux/demux_mov.c10
-rw-r--r--libmpdemux/parse_mp4.h2
2 files changed, 11 insertions, 1 deletions
diff --git a/libmpdemux/demux_mov.c b/libmpdemux/demux_mov.c
index a204cea7f5..9b21c93be4 100644
--- a/libmpdemux/demux_mov.c
+++ b/libmpdemux/demux_mov.c
@@ -807,7 +807,9 @@ static void lschunks(demuxer_t* demuxer,int level,off_t endpos,mov_track_t* trak
if(atom_len > 8) {
esds_t esds;
if(!mp4_parse_esds(&trak->stdata[36+adjust], atom_len-8, &esds)) {
- if(sh->format==0x6134706D && esds.decoderConfigLen > 8)
+ /* 0xdd is a "user private" id, not an official allocated id (see http://www.mp4ra.org/object.html),
+ so perform some extra checks to be sure that this is really vorbis audio */
+ if(esds.objectTypeId==0xdd && esds.streamType==0x15 && sh->format==0x6134706D && esds.decoderConfigLen > 8)
{
//vorbis audio
unsigned char *buf[3];
@@ -861,6 +863,12 @@ quit_vorbis_block:
if(esds.objectTypeId==MP4OTI_MPEG1Audio || esds.objectTypeId==MP4OTI_MPEG2AudioPart3)
sh->format=0x55; // .mp3
+ if(esds.objectTypeId==MP4OTI_13kVoice) { // 13K Voice, defined by 3GPP2
+ sh->format=mmioFOURCC('Q', 'c', 'l', 'p');
+ trak->nchannels=sh->channels=1;
+ trak->samplebytes=sh->samplesize=1;
+ }
+
// dump away the codec specific configuration for the AAC decoder
if(esds.decoderConfigLen){
if( (esds.decoderConfig[0]>>3) == 29 )
diff --git a/libmpdemux/parse_mp4.h b/libmpdemux/parse_mp4.h
index 3cf6dbcf79..5fbb3422e3 100644
--- a/libmpdemux/parse_mp4.h
+++ b/libmpdemux/parse_mp4.h
@@ -59,6 +59,8 @@
#define MP4OTI_MPEG1Audio 0x6B
/* JPEG visual stream */
#define MP4OTI_JPEG 0x6C
+/* 3GPP2 */
+#define MP4OTI_13kVoice 0xE1
/* I define uint24 here for better understanding */
#ifndef uint24_t