From 5a6d95b330fbabe0eb6cf75c94468a69bb8701eb Mon Sep 17 00:00:00 2001 From: Rintaro Kuroiwa Date: Fri, 27 Jun 2014 18:11:57 -0700 Subject: [PATCH] Use bandwidth in muxer options Change-Id: Ic284528d44c5159af0c1495114556e06991b81f5 --- media/event/muxer_listener_internal.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/media/event/muxer_listener_internal.cc b/media/event/muxer_listener_internal.cc index e41a0940d9..774a27cd4c 100644 --- a/media/event/muxer_listener_internal.cc +++ b/media/event/muxer_listener_internal.cc @@ -165,6 +165,9 @@ bool GenerateMediaInfo(const MuxerOptions& muxer_options, SetMediaInfoStreamInfo(stream_infos, media_info); media_info->set_reference_time_scale(reference_time_scale); SetMediaInfoContainerType(container_type, media_info); + if (muxer_options.bandwidth > 0) + media_info->set_bandwidth(muxer_options.bandwidth); + return true; } @@ -198,8 +201,11 @@ bool SetVodInformation(bool has_init_range, media_info); media_info->set_media_duration_seconds(duration_seconds); - media_info->set_bandwidth( - EstimateRequiredBandwidth(file_size, duration_seconds)); + + if (!media_info->has_bandwidth()) { + media_info->set_bandwidth( + EstimateRequiredBandwidth(file_size, duration_seconds)); + } return true; }