[FFmpeg-devel] [PATCH 5/6] ffplay: use PTS from the AVSubtitle structure.

Marton Balint cus at passwd.hu
Mon Sep 10 00:25:18 CEST 2012



On Sun, 9 Sep 2012, Philip Langdale wrote:

> On 09.09.2012 07:50, Nicolas George wrote:
>> Signed-off-by: Nicolas George <nicolas.george at normalesup.org>
>> ---
>>  ffplay.c |    2 ++
>>  1 file changed, 2 insertions(+)
>> 
>> 
>> This patch fixes trac ticket #1722 in the case when the file is played 
>> using
>> ffplay.
>> 
>> 
>> diff --git a/ffplay.c b/ffplay.c
>> index 2a07be1..d56bee9 100644
>> --- a/ffplay.c
>> +++ b/ffplay.c
>> @@ -1839,6 +1839,8 @@ static int subtitle_thread(void *arg)
>>
>>          avcodec_decode_subtitle2(is->subtitle_st->codec, &sp->sub,
>>                                   &got_subtitle, pkt);
>> +        if (sp->sub.pts != AV_NOPTS_VALUE)
>> +            pts = sp->sub.pts / (double)AV_TIME_BASE;

Nit: Isn't it better if you only set pts when got_subtitle is true?

>>
>>          if (got_subtitle && sp->sub.format == 0) {
>>              sp->pts = pts;
>
> LGTM.

Otherwise LGTM too.

Regards,
Marton


More information about the ffmpeg-devel mailing list