[vlc-commits] Smooth Streaming: fix manifest parsing (FourCC)

Frédéric Yhuel git at videolan.org
Fri Oct 5 19:30:50 CEST 2012


vlc | branch: master | Frédéric Yhuel <yhuelf at gmail.com> | Fri Oct  5 19:19:56 2012 +0200| [c892cfc936055725dd7f60d043c6d10399e6f6f6] | committer: Jean-Baptiste Kempf

Smooth Streaming: fix manifest parsing (FourCC)

This patch fixes playback for this VOD stream:
http://mediadl.microsoft.com/mediadl/IISNET/SmoothMedia/Learn/795/Bill_Staples_Cineform.ism/Manifest

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/stream_filter/smooth/downloader.c |    4 +++-
 modules/stream_filter/smooth/smooth.c     |    3 +++
 modules/stream_filter/smooth/smooth.h     |    1 +
 3 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/modules/stream_filter/smooth/downloader.c b/modules/stream_filter/smooth/downloader.c
index 33cd09e..b5222d4 100644
--- a/modules/stream_filter/smooth/downloader.c
+++ b/modules/stream_filter/smooth/downloader.c
@@ -276,6 +276,7 @@ static int build_smoo_box( stream_t *s, uint8_t *smoo_box )
 {
     stream_sys_t *p_sys = s->p_sys;
     sms_stream_t *sms = NULL;
+    uint32_t FourCC;
 
     /* smoo */
     memset( smoo_box, 0, SMOO_SIZE );
@@ -327,7 +328,8 @@ static int build_smoo_box( stream_t *s, uint8_t *smoo_box )
 
         quality_level_t * qlvl = get_qlevel( sms, sms->download_qlvl );
 
-        ((uint32_t *)stra_box)[16] = bswap32( qlvl->FourCC );
+        FourCC = qlvl->FourCC ? qlvl->FourCC : sms->default_FourCC;
+        ((uint32_t *)stra_box)[16] = bswap32( FourCC );
         ((uint32_t *)stra_box)[17] = bswap32( qlvl->Bitrate );
         ((uint32_t *)stra_box)[18] = bswap32( qlvl->MaxWidth );
         ((uint32_t *)stra_box)[19] = bswap32( qlvl->MaxHeight );
diff --git a/modules/stream_filter/smooth/smooth.c b/modules/stream_filter/smooth/smooth.c
index 01281cc..3e7d9a5 100644
--- a/modules/stream_filter/smooth/smooth.c
+++ b/modules/stream_filter/smooth/smooth.c
@@ -203,6 +203,9 @@ static int parse_Manifest( stream_t *s )
                             stream_name = strdup( value );
                         if( !strcmp( name, "TimeScale" ) )
                             sms->timescale = strtoull( value, NULL, 10 );
+                        if( !strcmp( name, "FourCC" ) )
+                            sms->default_FourCC =
+                                VLC_FOURCC( value[0], value[1], value[2], value[3] );
 
                         if( !strcmp( name, "Chunks" ) )
                         {
diff --git a/modules/stream_filter/smooth/smooth.h b/modules/stream_filter/smooth/smooth.h
index 32adda6..04d2079 100644
--- a/modules/stream_filter/smooth/smooth.h
+++ b/modules/stream_filter/smooth/smooth.h
@@ -73,6 +73,7 @@ typedef struct sms_stream_s
 {
     vlc_array_t    *qlevels;       /* list of available Quality Levels */
     vlc_array_t    *chunks;        /* list of chunks */
+    uint32_t       default_FourCC;
     unsigned       vod_chunks_nb;  /* total num of chunks of the VOD stream */
     unsigned       timescale;
     unsigned       qlevel_nb;      /* number of quality levels */



More information about the vlc-commits mailing list