[FFmpeg-devel] [PATCH 10/11] fftools/ffmpeg: stop injecting stream side data in packets

Anton Khirnov anton at khirnov.net
Tue Oct 3 14:04:49 EEST 2023


Quoting James Almer (2023-09-27 15:12:41)
> This is no longer needed as the side data is available for decoders in the
> AVCodecContext.
> The tests affected reflect the removal of useless CPB and Stereo 3D side
> data in packets.
> 
> Signed-off-by: James Almer <jamrial at gmail.com>
> ---
>  fftools/ffmpeg_demux.c                        | 22 -------------------
>  tests/ref/fate/autorotate                     |  4 ++--
>  tests/ref/fate/copy-trac3074                  |  2 +-
>  tests/ref/fate/matroska-avoid-negative-ts     |  2 +-
>  tests/ref/fate/matroska-dovi-write-config7    |  2 +-
>  tests/ref/fate/matroska-dovi-write-config8    |  2 +-
>  tests/ref/fate/matroska-encoding-delay        |  2 +-
>  .../fate/matroska-mastering-display-metadata  |  4 ++--
>  tests/ref/fate/matroska-spherical-mono-remux  |  4 ++--
>  tests/ref/fate/matroska-stereo_mode           |  8 +++----
>  tests/ref/fate/matroska-vp8-alpha-remux       |  2 +-
>  .../ref/fate/mov-mp4-disposition-mpegts-remux |  4 ++--
>  tests/ref/fate/mxf-d10-user-comments          |  2 +-
>  tests/ref/fate/mxf-remux-applehdr10           |  2 +-
>  tests/ref/fate/vp9-superframe-bsf             |  2 +-
>  15 files changed, 21 insertions(+), 43 deletions(-)
> 
> diff --git a/fftools/ffmpeg_demux.c b/fftools/ffmpeg_demux.c
> index b312ff4922..aad5215d94 100644
> --- a/fftools/ffmpeg_demux.c
> +++ b/fftools/ffmpeg_demux.c
> @@ -480,28 +480,6 @@ static int input_packet_process(Demuxer *d, DemuxMsg *msg, AVPacket *src)
>      ds->data_size += pkt->size;
>      ds->nb_packets++;
>  
> -    /* add the stream-global side data to the first packet */
> -    if (ds->nb_packets == 1) {
> -        for (int i = 0; i < ist->st->codecpar->nb_side_data; i++) {
> -            AVPacketSideData *src_sd = &ist->st->codecpar->side_data[i];
> -            uint8_t *dst_data;
> -
> -            if (src_sd->type == AV_PKT_DATA_DISPLAYMATRIX)
> -                continue;
> -
> -            if (av_packet_get_side_data(pkt, src_sd->type, NULL))
> -                continue;
> -
> -            dst_data = av_packet_new_side_data(pkt, src_sd->type, src_sd->size);
> -            if (!dst_data) {
> -                ret = AVERROR(ENOMEM);
> -                goto fail;
> -            }
> -
> -            memcpy(dst_data, src_sd->data, src_sd->size);
> -        }
> -    }

🎉

-- 
Anton Khirnov


More information about the ffmpeg-devel mailing list