[MPlayer-cvslog] r34972 - trunk/libmpdemux/demux_real.c

rtogni subversion at mplayerhq.hu
Sun May 27 20:12:42 CEST 2012


Author: rtogni
Date: Sun May 27 20:12:42 2012
New Revision: 34972

Log:
Add ralf audio support

Modified:
   trunk/libmpdemux/demux_real.c

Modified: trunk/libmpdemux/demux_real.c
==============================================================================
--- trunk/libmpdemux/demux_real.c	Fri May 25 22:31:11 2012	(r34971)
+++ trunk/libmpdemux/demux_real.c	Sun May 27 20:12:42 2012	(r34972)
@@ -1493,7 +1493,26 @@ static demuxer_t* demux_open_real(demuxe
 
 		    ++a_streams;
 	  } else if (strstr(mimet,"x-ralf-mpeg4")) {
-		 mp_msg(MSGT_DEMUX,MSGL_ERR,"Real lossless audio not supported yet\n");
+		    sh_audio_t *sh = new_sh_audio(demuxer, stream_id, NULL);
+    		    mp_msg(MSGT_DEMUX, MSGL_INFO, MSGTR_AudioID, "real", stream_id);
+
+		    // Check extradata len, we can't store bigger values in cbSize anyway
+		    if ((unsigned)codec_data_size > 0xffff) {
+		        mp_msg(MSGT_DEMUX,MSGL_ERR,"Extradata too big (%d)\n", codec_data_size);
+			goto skip_this_chunk;
+		    }
+		    /* Emulate WAVEFORMATEX struct: */
+		    sh->wf = calloc(1, sizeof(*sh->wf)+codec_data_size);
+		    sh->wf->nChannels = 0;
+		    sh->wf->wBitsPerSample = 16;
+		    sh->wf->nSamplesPerSec = 0;
+		    sh->wf->nAvgBytesPerSec = 0;
+		    sh->wf->nBlockAlign = 0;
+		    sh->wf->wFormatTag = sh->format = mmioFOURCC('L','S','D',':');
+		    sh->wf->cbSize = codec_data_size;
+		    stream_read(demuxer->stream, (char*)(sh->wf+1), codec_data_size);
+
+		    ++a_streams;
 	  } else if (strstr(mimet,"x-pn-encrypted-ra")) {
 		 mp_msg(MSGT_DEMUX,MSGL_ERR,"Encrypted audio is not supported\n");
 	  } else {


More information about the MPlayer-cvslog mailing list