[FFmpeg-cvslog] applehttp: Don't export variant_bitrate if it isn't known

Martin Storsjö git at videolan.org
Mon Apr 25 02:32:49 CEST 2011


ffmpeg | branch: master | Martin Storsjö <martin at martin.st> | Sun Apr 24 20:19:49 2011 +0300| [5f85d49b6889b9a2ecd18695fe52c5c9b698a0e1] | committer: Martin Storsjö

applehttp: Don't export variant_bitrate if it isn't known

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.

Signed-off-by: Martin Storsjö <martin at martin.st>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5f85d49b6889b9a2ecd18695fe52c5c9b698a0e1
---

 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;
     }



More information about the ffmpeg-cvslog mailing list