[FFmpeg-devel] [PATCH] RTP depacketizer for AMR

Luca Abeni lucabe72
Wed Jan 27 18:09:29 CET 2010

Martin Storsj? wrote:
> On Wed, 27 Jan 2010, Luca Abeni wrote:
>>> It seems to me that the missing timestamps aren't filled in automatically by
>>> libavformat. Around lines 421-424 in rtpdec.c, the timestamp is set to 0
>> Congratulations, I think you just found a bug ;-)
>> That should be AV_NOPTS_VALUE, not 0.
>> Can you try this change and see what happens if the payload handler does
>> not mess with timestamps?
> No, that won't work. "timestamp" in this case is an uint32_t, not an 
> int64_t as the AVPacket::pts field.

Ah, ok... So, a different solution has to be used. But my idea is still that
the packet pts should be set to AV_NOPTS_VALUE.

> But as far as I can see, the dynamic rtp packetload handlers really are 
> intended to set the timestamp in this way. From rtpdec.h:
> /**
>  * Packet parsing for "private" payloads in the RTP specs.
> [...]
>  * @param timestamp pointer in which to write the timestamp of this RTP 
> packet
>  */
> typedef int (*DynamicPayloadPacketHandlerProc) (AVFormatContext *ctx,
>                                                 PayloadContext *s,
>                                                 AVStream *st,
>                                                 AVPacket * pkt,
>                                                 uint32_t *timestamp,
>                                                 const uint8_t * buf,
>                                                 int len, int flags);
> If they were not intended to set the timestamp, the timestamp parameter 
> wouldn't be a pointer.

I believe that the timestamp parameter should not eve exist here ;-)
But at this point I leave this to the maintainer.


More information about the ffmpeg-devel mailing list