[FFmpeg-devel] [PATCH] [RFC] avformat: use "genpts" option for output file.

Benoit Fouet benoit.fouet at free.fr
Mon Nov 3 15:23:13 CET 2014


Forgot to mention that this is a possible fix for #1150 and #1598...

----- Mail original -----
> When "-fflags +genpts" is used for output file, use dts as pts.
> 
> Signed-off-by: Benoit Fouet <benoit.fouet at free.fr>
> ---
>  libavformat/mux.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/libavformat/mux.c b/libavformat/mux.c
> index 5e45bd8..1d42451 100644
> --- a/libavformat/mux.c
> +++ b/libavformat/mux.c
> @@ -884,6 +884,9 @@ int av_interleaved_write_frame(AVFormatContext
> *s, AVPacket *pkt)
>              ret = AVERROR(EINVAL);
>              goto fail;
>          }
> +
> +        if (pkt->pts == AV_NOPTS_VALUE && s->flags &
> AVFMT_FLAG_GENPTS)
> +            pkt->pts = pkt->dts;
>      } else {
>          av_dlog(s, "av_interleaved_write_frame FLUSH\n");
>          flush = 1;
> --
> 2.1.2.532.g19b5d50
> 


More information about the ffmpeg-devel mailing list