[vlc-devel] commit: Real demux: correctly set the subpacket size when SIPR is used ( Jean-Baptiste Kempf )

git version control git at videolan.org
Fri Jan 22 20:48:57 CET 2010


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Fri Jan 22 14:16:52 2010 +0100| [fd112a947820cfd5bf0fa54cd004b65e03877c6d] | committer: Jean-Baptiste Kempf 

Real demux: correctly set the subpacket size when SIPR is used

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=fd112a947820cfd5bf0fa54cd004b65e03877c6d
---

 modules/demux/real.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/modules/demux/real.c b/modules/demux/real.c
index 6fe6693..d80c2df 100644
--- a/modules/demux/real.c
+++ b/modules/demux/real.c
@@ -145,6 +145,8 @@ struct demux_sys_t
     real_index_t *p_index;
 };
 
+static const unsigned char i_subpacket_size_sipr[4] = { 29, 19, 37, 20 };
+
 static int Demux( demux_t * );
 static int Control( demux_t *, int i_query, va_list args );
 
@@ -722,6 +724,7 @@ static void DemuxAudioMethod1( demux_t *p_demux, real_track_t *tk, mtime_t i_pts
         tk->i_out_subpacket = 0;
     }
 }
+
 static void DemuxAudioMethod2( demux_t *p_demux, real_track_t *tk, mtime_t i_pts )
 {
     demux_sys_t *p_sys = p_demux->p_sys;
@@ -1488,6 +1491,12 @@ static int CodecAudioParse( demux_t *p_demux, int i_tk_id, const uint8_t *p_data
     case VLC_FOURCC( 's','i','p','r' ):
         fmt.i_codec = VLC_CODEC_SIPR;
         fmt.audio.i_flavor = i_flavor;
+        if( i_flavor > 3 )
+            return VLC_EGENERIC;
+
+        i_subpacket_size = i_subpacket_size_sipr[i_flavor];
+        msg_Dbg( p_demux, "    - sipr flavor=%i", i_flavor );
+
     case VLC_FOURCC( 'c','o','o','k' ):
     case VLC_FOURCC( 'a','t','r','c' ):
         if( i_subpacket_size <= 0 || i_frame_size / i_subpacket_size <= 0 )




More information about the vlc-devel mailing list