Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: "Tomas Härdin" <tjoppen@acc.umu.se>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [PATCH 13/15] avformat/mux, mxfenc: Don't use sizeof(AVPacket)
Date: Tue, 21 Dec 2021 14:52:46 +0100
Message-ID: <a4438124ad0784d5dc6ba6082d6d622fba931caf.camel@acc.umu.se> (raw)
In-Reply-To: <AM7PR03MB666078808FDDAD1E5393C4408F779@AM7PR03MB6660.eurprd03.prod.outlook.com>

tor 2021-12-16 klockan 02:29 +0100 skrev Andreas Rheinhardt:
> This removes the last usage of sizeof(AVPacket) in the generic
> muxing code.
> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> ---
>  libavformat/mux.c    | 8 +-------
>  libavformat/mxfenc.c | 8 ++------
>  2 files changed, 3 insertions(+), 13 deletions(-)
> 
> diff --git a/libavformat/mux.c b/libavformat/mux.c
> index b9c4abb9cf..0500f636de 100644
> --- a/libavformat/mux.c
> +++ b/libavformat/mux.c
> @@ -1014,15 +1014,9 @@ int
> ff_interleave_packet_per_dts(AVFormatContext *s, AVPacket *pkt,
>          AVStream *const st = s->streams[pktl->pkt.stream_index];
>          FFStream *const sti = ffstream(st);
>  
> -        *pkt = pktl->pkt;
> -
> -        si->packet_buffer = pktl->next;
> -        if (!si->packet_buffer)
> -            si->packet_buffer_end = NULL;
> -
>          if (sti->last_in_packet_buffer == pktl)
>              sti->last_in_packet_buffer = NULL;
> -        av_freep(&pktl);
> +        avpriv_packet_list_get(&si->packet_buffer, &si-
> >packet_buffer_end, pkt);
>  
>          return 1;
>      } else {
> diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c
> index 00bbe58149..7635e183d0 100644
> --- a/libavformat/mxfenc.c
> +++ b/libavformat/mxfenc.c
> @@ -3125,14 +3125,10 @@ static int
> mxf_interleave_get_packet(AVFormatContext *s, AVPacket *out, int flus
>              pktl = si->packet_buffer;
>          }
>  
> -        *out = pktl->pkt;
> -        av_log(s, AV_LOG_TRACE, "out st:%d dts:%"PRId64"\n",
> (*out).stream_index, (*out).dts);
> -        si->packet_buffer = pktl->next;
>          if (ffstream(s->streams[pktl->pkt.stream_index])-
> >last_in_packet_buffer == pktl)
>              ffstream(s->streams[pktl->pkt.stream_index])-
> >last_in_packet_buffer = NULL;
> -        if (!si->packet_buffer)
> -            si->packet_buffer_end = NULL;
> -        av_freep(&pktl);
> +        avpriv_packet_list_get(&si->packet_buffer, &si-
> >packet_buffer_end, out);
> +        av_log(s, AV_LOG_TRACE, "out st:%d dts:%"PRId64"\n", out-
> >stream_index, out->dts);
>          return 1;
>      } else {
>      out:

Looks like this makes the code simpler, which is fine by me

/Tomas

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

  reply	other threads:[~2021-12-21 13:52 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-15 12:29 [FFmpeg-devel] [PATCH 01/11] avcodec/Makefile: Remove superfluous avformat->DNXHD dependencies Andreas Rheinhardt
2021-12-15 12:35 ` [FFmpeg-devel] [PATCH 02/11] avcodec/raw: Reduce number of avpriv symbols Andreas Rheinhardt
2021-12-20 15:03   ` Andreas Rheinhardt
2021-12-30  9:55   ` Anton Khirnov
2022-01-03  5:33     ` Andreas Rheinhardt
2022-01-03 10:38   ` Andreas Rheinhardt
2021-12-15 12:35 ` [FFmpeg-devel] [PATCH 03/11] Makefile: Redo duplicating object files in shared builds Andreas Rheinhardt
2021-12-15 12:35 ` [FFmpeg-devel] [PATCH 04/11] avcodec/ac3tab: Unavpriv ac3_channel_layout_tab Andreas Rheinhardt
2021-12-30 10:12   ` Anton Khirnov
2021-12-31 13:28     ` Andreas Rheinhardt
2021-12-15 12:35 ` [FFmpeg-devel] [PATCH 05/11] avcodec/dca: Unavpriv dca_sample_rates Andreas Rheinhardt
2021-12-15 12:35 ` [FFmpeg-devel] [PATCH 06/11] avcodec/jpegtables: Unavpriv MJPEG-tables Andreas Rheinhardt
2021-12-15 12:35 ` [FFmpeg-devel] [PATCH 07/11] configure, avcodec/Makefile: Add new mpeg4audio CONFIG_EXTRA group Andreas Rheinhardt
2021-12-15 12:35 ` [FFmpeg-devel] [PATCH 08/11] avcodec/mpeg4audio: Unavpriv and deduplicate mpeg4audio_sample_rates Andreas Rheinhardt
2021-12-15 12:35 ` [FFmpeg-devel] [PATCH 09/11] avcodec/mpegaudiodata: Unavpriv mpa_bitrate and mpa_frequency tabs Andreas Rheinhardt
2021-12-15 12:35 ` [FFmpeg-devel] [PATCH 10/11] avcodec/internal: Remove unused av_export_avcodec Andreas Rheinhardt
2021-12-15 12:35 ` [FFmpeg-devel] [PATCH 11/11] avcodec/utils: Unavpriv avpriv_toupper4() Andreas Rheinhardt
2021-12-16  1:29 ` [FFmpeg-devel] [PATCH 12/15] avformat/(aiff|flac|mov|mp3|tta)enc: Don't create unnecessary references Andreas Rheinhardt
2021-12-16  1:29 ` [FFmpeg-devel] [PATCH 13/15] avformat/mux, mxfenc: Don't use sizeof(AVPacket) Andreas Rheinhardt
2021-12-21 13:52   ` Tomas Härdin [this message]
2021-12-16  1:29 ` [FFmpeg-devel] [PATCH 14/15] avcodec/packet_internal: Add proper PacketList struct Andreas Rheinhardt
2021-12-16  1:29 ` [FFmpeg-devel] [PATCH 15/15] avformat/movenc: Use dedicated pointer for access to MOVTrack Andreas Rheinhardt
2021-12-17 22:52 ` [FFmpeg-devel] [PATCH 01/11] avcodec/Makefile: Remove superfluous avformat->DNXHD dependencies Andreas Rheinhardt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a4438124ad0784d5dc6ba6082d6d622fba931caf.camel@acc.umu.se \
    --to=tjoppen@acc.umu.se \
    --cc=ffmpeg-devel@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git