changeset 19363:2e3981fa938c

Add support for 13k Voice (Qclp) in 3g2 files Fix vorbis detection so that it doesn't misdetect other codecs
author rtogni
date Fri, 11 Aug 2006 22:57:33 +0000
parents 3a998ae2f952
children 6ccc6a6bf875
files libmpdemux/demux_mov.c libmpdemux/parse_mp4.h
diffstat 2 files changed, 11 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_mov.c	Fri Aug 11 17:10:57 2006 +0000
+++ b/libmpdemux/demux_mov.c	Fri Aug 11 22:57:33 2006 +0000
@@ -807,7 +807,9 @@
 			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 @@
 			    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 )
--- a/libmpdemux/parse_mp4.h	Fri Aug 11 17:10:57 2006 +0000
+++ b/libmpdemux/parse_mp4.h	Fri Aug 11 22:57:33 2006 +0000
@@ -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