Never write 0 as maximum bitrate for asf files.
authorCarl Eugen Hoyos <cehoyos@ag.or.at>
Thu, 24 Apr 2014 15:47:49 +0000 (17:47 +0200)
committerCarl Eugen Hoyos <cehoyos@ag.or.at>
Thu, 24 Apr 2014 15:47:49 +0000 (17:47 +0200)
WMP refuses to play such streams.

libavformat/asfenc.c

index 6ed4c0b..8add6e0 100644 (file)
@@ -408,7 +408,7 @@ static int asf_write_header1(AVFormatContext *s, int64_t file_size,
     avio_wl32(pb, (asf->is_streamed || !pb->seekable) ? 3 : 2);  /* ??? */
     avio_wl32(pb, s->packet_size); /* packet size */
     avio_wl32(pb, s->packet_size); /* packet size */
-    avio_wl32(pb, bit_rate); /* Nominal data rate in bps */
+    avio_wl32(pb, bit_rate ? bit_rate : -1); /* Maximum data rate in bps */
     end_header(pb, hpos);
 
     /* unknown headers */