[FFmpeg-devel] [PATCH] avcodec: add a bsf to reorder DTS into PTS

James Almer jamrial at gmail.com
Tue Oct 4 04:58:49 EEST 2022


On 9/28/2022 12:39 PM, Anton Khirnov wrote:
> Quoting James Almer (2022-09-23 16:27:32)
>> On 9/23/2022 10:06 AM, Anton Khirnov wrote:
>>>> +static int dts2pts_filter(AVBSFContext *ctx, AVPacket *out)
>>>> +{
>>>> +    DTS2PTSContext *s = ctx->priv_data;
>>>> +    DTS2PTSNode *poc_node = NULL, *next[2] = { NULL, NULL };
>>>> +    DTS2PTSFrame frame;
>>>> +    int ret;
>>>> +
>>>> +    // Fill up the FIFO and POC tree
>>>> +    if (!s->eof && av_fifo_can_write(s->fifo)) {
>>>
>>> More than one packet can be available, so this should probably be a
>>> loop.
>>
>> What do you mean? AVBSFContext can contain at most one buffered packet.
> 
> I'd prefer if filters didn't make any such assumptions.

Will make that change and apply.


More information about the ffmpeg-devel mailing list