[vlc-commits] mux/asf.c: Workaround for playback of WMV in WMP12 and Silverlight.
Jean-Paul Saman
git at videolan.org
Sat Oct 29 11:09:49 CEST 2011
vlc/vlc-1.1 | branch: master | Jean-Paul Saman <jean-paul.saman at m2x.nl> | Sat Oct 29 10:41:51 2011 +0200| [200e74d795028aec579f16013648a36a78279325] | 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/vlc-1.1.git/?a=commit;h=200e74d795028aec579f16013648a36a78279325
---
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 1ab1943..6dfb5d6 100644
--- a/modules/mux/asf.c
+++ b/modules/mux/asf.c
@@ -982,7 +982,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