[FFmpeg-devel] [PATCH] ffmpeg: use actual packet pts when discarding for the copypriorss option

Michael Niedermayer michaelni at gmx.at
Thu May 23 21:02:32 CEST 2013


On Thu, May 23, 2013 at 01:13:02PM -0400, Derek Buitenhuis wrote:
> From: Justin Ruggles <justin.ruggles at gmail.com>
> 
> The ist->pts value at this point does not necessarily match the actual packet
> pts, which is what should be used to decide whether to discard the packet.
> Without this change, some video packets that have pts on or after the start
> time are getting discarded when they should not be.

how can i reproduce this problem ?


> 
> Signed-off-by: Derek Buitenhuis <derek.buitenhuis at gmail.com>
> ---
>  ffmpeg.c |    3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/ffmpeg.c b/ffmpeg.c
> index 785c334..e761b6d 100644
> --- a/ffmpeg.c
> +++ b/ffmpeg.c
> @@ -1388,6 +1388,7 @@ static void do_streamcopy(InputStream *ist, OutputStream *ost, const AVPacket *p
>  {
>      OutputFile *of = output_files[ost->file_index];
>      int64_t ost_tb_start_time = av_rescale_q(of->start_time, AV_TIME_BASE_Q, ost->st->time_base);
> +    int64_t ist_tb_start_time = av_rescale_q(of->start_time, AV_TIME_BASE_Q, ist->st->time_base);
>      AVPicture pict;
>      AVPacket opkt;
>  
> @@ -1397,7 +1398,7 @@ static void do_streamcopy(InputStream *ist, OutputStream *ost, const AVPacket *p
>          !ost->copy_initial_nonkeyframes)
>          return;
>  
> -    if (!ost->frame_number && ist->pts < of->start_time &&
> +    if (!ost->frame_number && pkt->pts < ist_tb_start_time &&

pkt->pts can be AV_NOPTS_VALUE here

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The greatest way to live with honor in this world is to be what we pretend
to be. -- Socrates
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130523/6d7d5b99/attachment.asc>


More information about the ffmpeg-devel mailing list