[vlc-devel] amr, rtp/rtsp, part 2.

Alex Antropoff alant at transtelecom.md
Sun Mar 19 19:17:13 CET 2006


Finally, I found the problem,
live555 library return amr frames without frame header, like it does it with 
H261.
Header stored in internal variable, so vlc must get it and insert before
frame data. Simple patch is made attached.

-- 
Regards, 
Alex Antropoff
-------------- next part --------------
--- vlc-svn-20060316.bak/modules/demux/livedotcom.cpp	2006-03-17 01:47:20.000000000 +0200
+++ vlc-svn-20060316/modules/demux/livedotcom.cpp	2006-03-19 19:32:19.550485152 +0200
@@ -1208,7 +1206,15 @@
         msg_Warn( p_demux, "buffer overflow" );
     }
     /* FIXME could i_size be > buffer size ? */
-    if( tk->fmt.i_codec == VLC_FOURCC('H','2','6','1') )
+    if( tk->fmt.i_codec == VLC_FOURCC('s','a','m','r') || tk->fmt.i_codec == VLC_FOURCC('s','a','w','b'))
+    {
+        AMRAudioSource *amrSource = (AMRAudioSource*)tk->readSource;
+
+        p_block = block_New( p_demux, i_size + 1 );
+      	 p_block->p_buffer[0] = amrSource->lastFrameHeader();
+        memcpy( p_block->p_buffer + 1, tk->p_buffer, i_size );
+
+    } else if( tk->fmt.i_codec == VLC_FOURCC('H','2','6','1') )
     {
 #if LIVEMEDIA_LIBRARY_VERSION_INT >= 1081468800
         H261VideoRTPSource *h261Source = (H261VideoRTPSource*)tk->rtpSource;


More information about the vlc-devel mailing list