changeset 14922:ed06939c5217

alac support via lavc decoder
author rtognimp
date Sun, 06 Mar 2005 17:55:31 +0000
parents 1f82d63df1cd
children 658fc109eefc
files etc/codecs.conf libmpcodecs/ad_ffmpeg.c libmpdemux/demux_mov.c
diffstat 3 files changed, 17 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/etc/codecs.conf	Sun Mar 06 17:31:55 2005 +0000
+++ b/etc/codecs.conf	Sun Mar 06 17:55:31 2005 +0000
@@ -2166,6 +2166,13 @@
   driver ffmpeg
   dll "flac"
 
+audiocodec ffalac
+  info "FFmpeg ALAC audio decoder"
+  status working
+  fourcc alac
+  driver ffmpeg
+  dll "alac"
+
 audiocodec pcm
   info "Uncompressed PCM"
   status working
--- a/libmpcodecs/ad_ffmpeg.c	Sun Mar 06 17:31:55 2005 +0000
+++ b/libmpcodecs/ad_ffmpeg.c	Sun Mar 06 17:55:31 2005 +0000
@@ -66,6 +66,7 @@
 	lavc_context->sample_rate = sh_audio->wf->nSamplesPerSec;
 	lavc_context->bit_rate = sh_audio->wf->nAvgBytesPerSec * 8;
 	lavc_context->block_align = sh_audio->wf->nBlockAlign;
+	lavc_context->bits_per_sample = sh_audio->wf->wBitsPerSample;
     }
     lavc_context->codec_tag = sh_audio->format; //FOURCC
     lavc_context->codec_id = lavc_codec->id; // not sure if required, imho not --A'rpi
--- a/libmpdemux/demux_mov.c	Sun Mar 06 17:31:55 2005 +0000
+++ b/libmpdemux/demux_mov.c	Sun Mar 06 17:55:31 2005 +0000
@@ -988,6 +988,15 @@
 #endif			  
 			}
 		      } break;
+		      case MOV_FOURCC('a','l','a','c'): {
+			mp_msg(MSGT_DEMUX, MSGL_INFO, "MOV: Found alac atom (%d)!\n", atom_len);
+			if(atom_len > 8) {
+			    // copy all the atom (not only payload) for lavc alac decoder
+			    sh->codecdata_len = atom_len;
+			    sh->codecdata = (unsigned char *)malloc(sh->codecdata_len);
+			    memcpy(sh->codecdata, &trak->stdata[28], sh->codecdata_len);
+			}
+		      } break;
 		      default:
 			mp_msg(MSGT_DEMUX, MSGL_INFO, "MOV: Found unknown audio atom %c%c%c%c (%d)!\n",
 			    trak->stdata[32+adjust],trak->stdata[33+adjust],trak->stdata[34+adjust],trak->stdata[35+adjust],