[FFmpeg-devel] [PATCH] ffplay: rename audio_decode_frame() variable "pts" to "audio_clock0"

Marton Balint cus at passwd.hu
Sun Feb 3 16:42:44 CET 2013



On Sun, 3 Feb 2013, Alexander Strasser wrote:

> Hi Stefano!
>
> Stefano Sabatini wrote:
>> The new name better expresses what the variable is.
>> ---
>>  ffplay.c |    8 ++++----
>>  1 file changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/ffplay.c b/ffplay.c
>> index c5902fa..e8151be 100644
>> --- a/ffplay.c
>> +++ b/ffplay.c
>> @@ -2097,7 +2097,7 @@ static int audio_decode_frame(VideoState *is)
>>      int len1, len2, data_size, resampled_data_size;
>>      int64_t dec_channel_layout;
>>      int got_frame;
>> -    av_unused double pts;
>> +    av_unused double audio_clock0;
>>      int new_packet = 0;
>>      int flush_complete = 0;
>>      int wanted_nb_samples;
>> @@ -2195,15 +2195,15 @@ static int audio_decode_frame(VideoState *is)
>>              }
>>
>>              /* if no pts, then compute it */
>> -            pts = is->audio_clock;
>> +            audio_clock0 = is->audio_clock;
>>              is->audio_clock += (double)data_size /
>>                  (is->frame->channels * is->frame->sample_rate * av_get_bytes_per_sample(is->frame->format));
>>  #ifdef DEBUG
>>              {
>>                  static double last_clock;
>> -                printf("audio: delay=%0.3f clock=%0.3f pts=%0.3f\n",
>> +                printf("audio: delay=%0.3f clock=%0.3f clock0=%0.3f\n",
>>                         is->audio_clock - last_clock,
>> -                       is->audio_clock, pts);
>> +                       is->audio_clock, clock0);
>                                           ^^^^^^
>
>  Am I missing something or are you missing audio_ prefix over there?

Yes, that seems like a typo for me too :)

>
>>                  last_clock = is->audio_clock;
>
>  I cannot say if the new name is better but it sounds reasonable.

Other than the above, LGTM, thanks.

Marton


More information about the ffmpeg-devel mailing list