comparison libmpdemux/demux_mov.c @ 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 24f2f73f03ca
children 80f8846c7df0
comparison
equal deleted inserted replaced
19362:3a998ae2f952 19363:2e3981fa938c
805 case MOV_FOURCC('e','s','d','s'): { 805 case MOV_FOURCC('e','s','d','s'): {
806 mp_msg(MSGT_DEMUX, MSGL_V, "MOV: Found MPEG4 audio Elementary Stream Descriptor atom (%d)!\n", atom_len); 806 mp_msg(MSGT_DEMUX, MSGL_V, "MOV: Found MPEG4 audio Elementary Stream Descriptor atom (%d)!\n", atom_len);
807 if(atom_len > 8) { 807 if(atom_len > 8) {
808 esds_t esds; 808 esds_t esds;
809 if(!mp4_parse_esds(&trak->stdata[36+adjust], atom_len-8, &esds)) { 809 if(!mp4_parse_esds(&trak->stdata[36+adjust], atom_len-8, &esds)) {
810 if(sh->format==0x6134706D && esds.decoderConfigLen > 8) 810 /* 0xdd is a "user private" id, not an official allocated id (see http://www.mp4ra.org/object.html),
811 so perform some extra checks to be sure that this is really vorbis audio */
812 if(esds.objectTypeId==0xdd && esds.streamType==0x15 && sh->format==0x6134706D && esds.decoderConfigLen > 8)
811 { 813 {
812 //vorbis audio 814 //vorbis audio
813 unsigned char *buf[3]; 815 unsigned char *buf[3];
814 unsigned short sizes[3]; 816 unsigned short sizes[3];
815 int offset, len, k; 817 int offset, len, k;
858 sh->i_bps = esds.avgBitrate/8; 860 sh->i_bps = esds.avgBitrate/8;
859 861
860 // printf("######## audio format = %d ########\n",esds.objectTypeId); 862 // printf("######## audio format = %d ########\n",esds.objectTypeId);
861 if(esds.objectTypeId==MP4OTI_MPEG1Audio || esds.objectTypeId==MP4OTI_MPEG2AudioPart3) 863 if(esds.objectTypeId==MP4OTI_MPEG1Audio || esds.objectTypeId==MP4OTI_MPEG2AudioPart3)
862 sh->format=0x55; // .mp3 864 sh->format=0x55; // .mp3
865
866 if(esds.objectTypeId==MP4OTI_13kVoice) { // 13K Voice, defined by 3GPP2
867 sh->format=mmioFOURCC('Q', 'c', 'l', 'p');
868 trak->nchannels=sh->channels=1;
869 trak->samplebytes=sh->samplesize=1;
870 }
863 871
864 // dump away the codec specific configuration for the AAC decoder 872 // dump away the codec specific configuration for the AAC decoder
865 if(esds.decoderConfigLen){ 873 if(esds.decoderConfigLen){
866 if( (esds.decoderConfig[0]>>3) == 29 ) 874 if( (esds.decoderConfig[0]>>3) == 29 )
867 sh->format = 0x1d61346d; // request multi-channel mp3 decoder 875 sh->format = 0x1d61346d; // request multi-channel mp3 decoder