On 02/26/2012 04:47 PM, Martin Storsjö wrote:

> On Sun, 26 Feb 2012, Justin Ruggles wrote:
> 
>> For encoding, frame_size is the number of input samples to send to the
>> encoder and is not necessarily the same as the duration of all output
>> packets.
>> ---
>> libavformat/movenc.c |   56 ++++++++++++++++++++++++++++++++++---------------
>> 1 files changed, 39 insertions(+), 17 deletions(-)
> 
> Looks good in general, but IMO needs a bit of splitting.

ok, i'll split it.

>> @@ -1107,9 +1141,7 @@ static int mov_write_stts_tag(AVIOContext *pb, 
>> MOVTrack *track)
>>                        av_malloc(track->entry * sizeof(*stts_entries)) : /* 
>> worst case */
>>                        NULL;
>>         for (i=0; i<track->entry; i++) {
>> -            int64_t duration = i + 1 == track->entry ?
>> -                track->track_duration - track->cluster[i].dts + 
>> track->start_dts : /* readjusting */
>> -                track->cluster[i+1].dts - track->cluster[i].dts;
>> +            int duration = get_cluster_duration(track, i);
>>             if (i && duration == stts_entries[entries].duration) {
>>                 stts_entries[entries].count++; /* compress */
>>             } else {
> 
> This changes the data type of duration fron int64_t to int, but I guess it 
> shouldn't make any difference (int makes more sense).


I suppose the function could do with a sanity check for the dts
difference being between 0 and INT_MAX.

-Justin

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to