[vlc-commits] mux/asf.c: Workaround for playback of WMV in WMP12 and Silverlight.

Jean-Paul Saman git at videolan.org
Sat Oct 29 10:42:51 CEST 2011


vlc | branch: master | Jean-Paul Saman <jean-paul.saman at m2x.nl> | Sat Oct 29 10:37:28 2011 +0200| [e59e805e0893d9c5726f58a1cfa7b701bdf6bca3] | committer: Jean-Paul Saman

mux/asf.c: Workaround for playback of WMV in WMP12 and Silverlight.

The maximum bitrate of the file is not allowed to become zero. If it
is then playback in WMP12 and Silverlight does not work. The actual
value for maximum bitrate does not really matter in these cases as
long as it is not 0.

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

 modules/mux/asf.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/modules/mux/asf.c b/modules/mux/asf.c
index fce8824..ceec09a 100644
--- a/modules/mux/asf.c
+++ b/modules/mux/asf.c
@@ -943,7 +943,10 @@ static block_t *asf_header_create( sout_mux_t *p_mux, bool b_broadcast )
     bo_addle_u32( &bo, b_broadcast ? 0x01 : 0x02 /* seekable */ ); /* flags */
     bo_addle_u32( &bo, p_sys->i_packet_size );  /* packet size min */
     bo_addle_u32( &bo, p_sys->i_packet_size );  /* packet size max */
-    bo_addle_u32( &bo, p_sys->i_bitrate );      /* maxbitrate */
+    /* NOTE: According to p6-9 of the ASF specification the bitrate cannot be 0,
+     * therefor apply this workaround to make sure it is not 0. If the bitrate is
+     * 0 the file will play in WMP11, but not in Sliverlight and WMP12 */
+    bo_addle_u32( &bo, p_sys->i_bitrate > 0 ? p_sys->i_bitrate : 1 ); /* maxbitrate */
 
     /* header extension */
     bo_add_guid ( &bo, &asf_object_header_extension_guid );



More information about the vlc-commits mailing list