[FFmpeg-devel] [PATCH] avformat/utils: improve get duration

Clément Bœsch ubitux at gmail.com
Thu May 30 17:26:46 CEST 2013


On Thu, May 30, 2013 at 11:20:22PM +0800, Ping Kai wrote:
> improve the accuracy of getting
> duration from bit rate.
> 
> Signed-off-by: Ping Kai <pingkai010 at gmail.com>

No need to send the patch twice.

> ---
>  libavformat/utils.c |   19 +++++++++++++++++--
>  1 file changed, 17 insertions(+), 2 deletions(-)
> 
> diff --git a/libavformat/utils.c b/libavformat/utils.c
> index baa7177..3a06a85 100644
> --- a/libavformat/utils.c
> +++ b/libavformat/utils.c
> @@ -2775,7 +2775,11 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
>      int64_t old_offset = avio_tell(ic->pb);
>      int orig_nb_streams = ic->nb_streams;        // new streams might appear, no options for those
>      int flush_codecs = ic->probesize > 0;
> +    int64_t *pSampleBitRateSum = (int64_t *)av_malloc(ic->nb_streams * sizeof(int64_t));

Please follow the surrounding coding style (check the variable names).
Don't cast your malloc, it's not C++ code.

[...]

-- 
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130530/27930f5a/attachment.asc>


More information about the ffmpeg-devel mailing list