Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH 1/6] lavc/decode: stop mangling last_pkt_props->opaque
@ 2023-03-10 11:56 Anton Khirnov
  2023-03-10 11:56 ` [FFmpeg-devel] [PATCH 2/6] fftools/ffprobe: stop using AVFrame.pkt_{pos, size} Anton Khirnov
                   ` (6 more replies)
  0 siblings, 7 replies; 17+ messages in thread
From: Anton Khirnov @ 2023-03-10 11:56 UTC (permalink / raw)
  To: ffmpeg-devel

It is currently abused to store packet size, which breaks
AV_CODEC_FLAG_COPY_OPAQUE.

Use stream_index instead, which is unused in libavcodec and has the
same type as size.
---
 libavcodec/decode.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavcodec/decode.c b/libavcodec/decode.c
index be2be81089..d1ba7f167f 100644
--- a/libavcodec/decode.c
+++ b/libavcodec/decode.c
@@ -140,7 +140,7 @@ static int extract_packet_props(AVCodecInternal *avci, const AVPacket *pkt)
     if (pkt) {
         ret = av_packet_copy_props(avci->last_pkt_props, pkt);
         if (!ret)
-            avci->last_pkt_props->opaque = (void *)(intptr_t)pkt->size; // Needed for ff_decode_frame_props().
+            avci->last_pkt_props->stream_index = pkt->size; // Needed for ff_decode_frame_props().
     }
     return ret;
 }
@@ -461,7 +461,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
         pkt->dts                  = AV_NOPTS_VALUE;
         if (!(codec->caps_internal & FF_CODEC_CAP_SETS_FRAME_PROPS)) {
             // See extract_packet_props() comment.
-            avci->last_pkt_props->opaque = (void *)((intptr_t)avci->last_pkt_props->opaque - consumed);
+            avci->last_pkt_props->stream_index = avci->last_pkt_props->stream_index - consumed;
             avci->last_pkt_props->pts = AV_NOPTS_VALUE;
             avci->last_pkt_props->dts = AV_NOPTS_VALUE;
         }
@@ -1355,7 +1355,7 @@ int ff_decode_frame_props(AVCodecContext *avctx, AVFrame *frame)
         int ret = ff_decode_frame_props_from_pkt(avctx, frame, pkt);
         if (ret < 0)
             return ret;
-        frame->pkt_size     = (int)(intptr_t)pkt->opaque;
+        frame->pkt_size = pkt->stream_index;
     }
 #if FF_API_REORDERED_OPAQUE
 FF_DISABLE_DEPRECATION_WARNINGS
-- 
2.39.1

_______________________________________________
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".

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2023-03-15 15:03 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-10 11:56 [FFmpeg-devel] [PATCH 1/6] lavc/decode: stop mangling last_pkt_props->opaque Anton Khirnov
2023-03-10 11:56 ` [FFmpeg-devel] [PATCH 2/6] fftools/ffprobe: stop using AVFrame.pkt_{pos, size} Anton Khirnov
2023-03-12 15:04   ` Stefano Sabatini
2023-03-10 11:56 ` [FFmpeg-devel] [PATCH 3/6] fftools/ffplay: drop an unused function argument Anton Khirnov
2023-03-12 15:05   ` Stefano Sabatini
2023-03-10 11:56 ` [FFmpeg-devel] [PATCH 4/6] fftools/ffplay: depend on avfilter Anton Khirnov
2023-03-10 11:56 ` [FFmpeg-devel] [PATCH 5/6] fftools/ffplay: stop using AVFrame.pkt_pos Anton Khirnov
2023-03-13 20:44   ` Marton Balint
2023-03-15 14:18     ` [FFmpeg-devel] [PATCH v2 4/5] " Anton Khirnov
2023-03-10 11:56 ` [FFmpeg-devel] [PATCH 6/6] lavu/frame: deprecate AVFrame.pkt_{pos, size} Anton Khirnov
2023-03-10 12:18   ` James Almer
2023-03-11 10:54     ` [FFmpeg-devel] [PATCH v2 " Anton Khirnov
2023-03-14 23:00       ` Michael Niedermayer
2023-03-15 15:03         ` Anton Khirnov
2023-03-10 12:11 ` [FFmpeg-devel] [PATCH 1/6] lavc/decode: stop mangling last_pkt_props->opaque Anton Khirnov
2023-03-10 12:39 ` Martin Storsjö
2023-03-11 10:51   ` Anton Khirnov

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