[FFmpeg-devel] [PATCH] ffmpeg.c: keep small last frame size

Justin Ruggles justinruggles
Sat Jul 19 17:18:14 CEST 2008


Michael Niedermayer wrote:
> On Sat, Jul 19, 2008 at 10:08:22AM -0400, Justin Ruggles wrote:
>> Hi,
>>
>> I noticed what I think is an error in a patch I submitted 2 years ago.
>> When the audio codec has CODEC_CAP_SMALL_LAST_FRAME, the original frame
>> size is being restored after the final encode.  I don't think this is
>> right, and would likely mess up the calculation of the final packet
>> duration.
> 
> encoder -> packet fifo -> muxer
> 
> 1. encoder encodes last frame (#100)
> 2. muxer takes frame #59 of the fifo and uses frame_size for something
> 
> no, i do not think your patch is correct

Oh, I see. I didn't consider the packet buffering...

So would a correct fix would be to set the packet duration at the
user-level for the final small packet since the generic audio duration
calculation assumes a fixed frame size?  Or does it not matter that the
packet duration is wrong?

Thanks,
Justin




More information about the ffmpeg-devel mailing list