[FFmpeg-devel] [PATCH] avformat/concatdec: get bit_rate from internal format

Nicolas George george at nsup.org
Mon Jan 4 09:02:11 CET 2016


Sorry for delaying my reply.

Zhang Rui:
> ---
>  libavformat/concatdec.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/libavformat/concatdec.c b/libavformat/concatdec.c
> index d21805f..4c7217c 100644
> --- a/libavformat/concatdec.c
> +++ b/libavformat/concatdec.c
> @@ -310,6 +310,7 @@ static int open_file(AVFormatContext *avf, unsigned fileno)
>          avformat_close_input(&cat->avf);
>          return ret;
>      }
> +    avf->bit_rate = cat->avf->bit_rate;
>      cat->cur_file = file;
>      if (file->start_time == AV_NOPTS_VALUE)
>          file->start_time = !fileno ? 0 :

I do not think this would be correct. The different concatenated files may
not have the same bit rate, therefore we can not know the real value without
opening all of them and averaging. This version would just have the value
change at each opened file, which is not supposed to happen.

The documentation says: "0 if not available", this is exactly what happens
here.

Why do you think this is useful?

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160104/2640049b/attachment.sig>


More information about the ffmpeg-devel mailing list