[libav-devel] [PATCH] applehttp: Don't export variant_bitrate if it isn't known

2011-04-24 Thread Martin Storsjö
If there are no variants, the total bitrate of the single
stream isn't known, and exporting variant_bitrate = 0 does
look weird, since there really aren't any variants.
---
 libavformat/applehttp.c |4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/libavformat/applehttp.c b/libavformat/applehttp.c
index 2e0e8a1..822d80b 100644
--- a/libavformat/applehttp.c
+++ b/libavformat/applehttp.c
@@ -505,7 +505,9 @@ static int applehttp_read_header(AVFormatContext *s, 
AVFormatParameters *ap)
 goto fail;
 }
 avcodec_copy_context(st-codec, v-ctx-streams[j]-codec);
-av_metadata_set2(st-metadata, variant_bitrate, bitrate_str, 0);
+if (v-bandwidth)
+av_metadata_set2(st-metadata, variant_bitrate, bitrate_str,
+ 0);
 }
 stream_offset += v-ctx-nb_streams;
 }
-- 
1.7.3.1

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH] applehttp: Don't export variant_bitrate if it isn't known

2011-04-24 Thread Ronald S. Bultje
Hi,

On Sun, Apr 24, 2011 at 1:23 PM, Martin Storsjö mar...@martin.st wrote:
 If there are no variants, the total bitrate of the single
 stream isn't known, and exporting variant_bitrate = 0 does
 look weird, since there really aren't any variants.
 ---
  libavformat/applehttp.c |    4 +++-
  1 files changed, 3 insertions(+), 1 deletions(-)

Yes, fine.

Ronald
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel