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

Ronald S. Bultje rsbultje
Wed Jan 27 18:22:54 CET 2010


Hi,

On Wed, Jan 27, 2010 at 12:09 PM, Luca Abeni <lucabe72 at email.it> wrote:
> 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?
[..]
>> 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.

Isn't that you? :-).

I forgot who made timestamp a pointer, was that me? I think it was,
and I think I applied it then changed rmdec.c so it wasn't necessary
(because it wasn't actually used anyways), and now it's just sitting
there. Anyone mind making it a non-pointer again?

I think the best thing here is to return whole packets since the
decoder handles that anyway. If needed, we'll write a AMR parser. And
RTP depacketizers should not mess with timestamps, it's the wrong
place.

Ronald



More information about the ffmpeg-devel mailing list