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/7] lavfi: ensure audio frame durations match the sample count
@ 2023-04-14 16:42 Anton Khirnov
  2023-04-14 16:42 ` [FFmpeg-devel] [PATCH 2/7] lavc/encode: do not use pkt_duration for encoding Anton Khirnov
                   ` (6 more replies)
  0 siblings, 7 replies; 10+ messages in thread
From: Anton Khirnov @ 2023-04-14 16:42 UTC (permalink / raw)
  To: ffmpeg-devel

---
 libavfilter/avfilter.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index 8d5702a0c8..d2e9ba47ef 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -997,6 +997,14 @@ int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
             av_log(link->dst, AV_LOG_ERROR, "Sample rate change is not supported\n");
             goto error;
         }
+
+        frame->duration = av_rescale_q(frame->nb_samples, (AVRational){ 1, frame->sample_rate },
+                                       link->time_base);
+#if FF_API_PKT_DURATION
+FF_DISABLE_DEPRECATION_WARNINGS
+        frame->pkt_duration = frame->duration;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
     }
 
     link->frame_blocked_in = link->frame_wanted_out = 0;
-- 
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] 10+ messages in thread

end of thread, other threads:[~2023-04-17  9:51 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-14 16:42 [FFmpeg-devel] [PATCH 1/7] lavfi: ensure audio frame durations match the sample count Anton Khirnov
2023-04-14 16:42 ` [FFmpeg-devel] [PATCH 2/7] lavc/encode: do not use pkt_duration for encoding Anton Khirnov
2023-04-14 16:42 ` [FFmpeg-devel] [PATCH 3/7] lavc/mjpegdec: simplify smvjpeg_receive_frame() Anton Khirnov
2023-04-14 16:42 ` [FFmpeg-devel] [PATCH 4/7] lavc/mjpegdec: properly set pts and duration for smvjpeg Anton Khirnov
2023-04-14 16:42 ` [FFmpeg-devel] [PATCH 5/7] fftools/sync_queue: update audio frame duration when re-chunking Anton Khirnov
2023-04-14 16:42 ` [FFmpeg-devel] [PATCH 6/7] fftools/ffmpeg_enc: set audio frame duration when encoding Anton Khirnov
2023-04-14 16:42 ` [FFmpeg-devel] [PATCH 7/7] fftools/ffmpeg: propagate frame durations to packets " Anton Khirnov
2023-04-14 16:51   ` Anton Khirnov
2023-04-17  7:33 ` [FFmpeg-devel] [PATCH 1/7] lavfi: ensure audio frame durations match the sample count Nicolas George
2023-04-17  9: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