[FFmpeg-devel] [PATCH 2/7] avformat/tee: Use ff_stream_encode_params_copy()

Nicolas George george at nsup.org
Mon Jul 11 17:23:00 EEST 2016


Le septidi 17 messidor, an CCXXIV, sebechlebskyjan at gmail.com a écrit :
> From: Jan Sebechlebsky <sebechlebskyjan at gmail.com>
> 
> Use ff_stream_encode_params_copy() to copy encoding-related
> fields (parameters) of stream.
> 
> Signed-off-by: Jan Sebechlebsky <sebechlebskyjan at gmail.com>
> ---
>  libavformat/tee.c | 14 +++-----------
>  1 file changed, 3 insertions(+), 11 deletions(-)
> 
> diff --git a/libavformat/tee.c b/libavformat/tee.c
> index 9d0a4cb..c276a37 100644
> --- a/libavformat/tee.c
> +++ b/libavformat/tee.c
> @@ -294,17 +294,9 @@ static int open_slave(AVFormatContext *avf, char *slave, TeeSlave *tee_slave)
>              ret = AVERROR(ENOMEM);
>              goto end;
>          }
> -        st2->id = st->id;
> -        st2->r_frame_rate        = st->r_frame_rate;
> -        st2->time_base           = st->time_base;
> -        st2->start_time          = st->start_time;

> -        st2->duration            = st->duration;

This one seems to have disappeared.

> -        st2->nb_frames           = st->nb_frames;
> -        st2->disposition         = st->disposition;
> -        st2->sample_aspect_ratio = st->sample_aspect_ratio;
> -        st2->avg_frame_rate      = st->avg_frame_rate;
> -        av_dict_copy(&st2->metadata, st->metadata, 0);
> -        if ((ret = avcodec_parameters_copy(st2->codecpar, st->codecpar)) < 0)
> +
> +        ret = ff_stream_encode_params_copy(st2, st);
> +        if (ret < 0)
>              goto end;
>      }
>  

Apart from that, looks ok.

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/20160711/347408f7/attachment.sig>


More information about the ffmpeg-devel mailing list