Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: James Almer <jamrial@gmail.com>
To: ffmpeg-devel@ffmpeg.org
Subject: [FFmpeg-devel] [PATCH 03/11] avcodec/evc_parser: export framerate to the AVCodecContext
Date: Thu, 15 Jun 2023 12:18:27 -0300
Message-ID: <20230615151836.50535-3-jamrial@gmail.com> (raw)
In-Reply-To: <20230615151836.50535-1-jamrial@gmail.com>

Signed-off-by: James Almer <jamrial@gmail.com>
---
 libavcodec/evc_parse.c  | 15 +++++++--------
 libavcodec/evc_parser.c |  1 +
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/libavcodec/evc_parse.c b/libavcodec/evc_parse.c
index f69d7ffb6b..68f0d31f96 100644
--- a/libavcodec/evc_parse.c
+++ b/libavcodec/evc_parse.c
@@ -605,14 +605,13 @@ int ff_evc_parse_nal_unit(EVCParserContext *ctx, const uint8_t *buf, int buf_siz
         if (sps->profile_idc == 1) ctx->profile = FF_PROFILE_EVC_MAIN;
         else ctx->profile = FF_PROFILE_EVC_BASELINE;
 
-        if (sps->vui_parameters_present_flag) {
-            if (sps->vui_parameters.timing_info_present_flag) {
-                int64_t num = sps->vui_parameters.num_units_in_tick;
-                int64_t den = sps->vui_parameters.time_scale;
-                if (num != 0 && den != 0)
-                    av_reduce(&ctx->framerate.den, &ctx->framerate.num, num, den, 1 << 30);
-            }
-        }
+        if (sps->vui_parameters_present_flag && sps->vui_parameters.timing_info_present_flag) {
+            int64_t num = sps->vui_parameters.num_units_in_tick;
+            int64_t den = sps->vui_parameters.time_scale;
+            if (num != 0 && den != 0)
+                av_reduce(&ctx->framerate.den, &ctx->framerate.num, num, den, 1 << 30);
+        } else
+            ctx->framerate = (AVRational) { 0, 1 };
 
         bit_depth = sps->bit_depth_chroma_minus8 + 8;
         ctx->format = AV_PIX_FMT_NONE;
diff --git a/libavcodec/evc_parser.c b/libavcodec/evc_parser.c
index 639dcbd135..5feb673b04 100644
--- a/libavcodec/evc_parser.c
+++ b/libavcodec/evc_parser.c
@@ -71,6 +71,7 @@ static int parse_nal_units(AVCodecParserContext *s, AVCodecContext *avctx, const
 
             s->format              = ctx->format;
 
+            avctx->framerate       = ctx->framerate;
             avctx->gop_size        = ctx->gop_size;
             avctx->delay           = ctx->delay;
             avctx->profile         = ctx->profile;
-- 
2.41.0

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

  parent reply	other threads:[~2023-06-15 15:19 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-15 15:18 [FFmpeg-devel] [PATCH 01/11] avformat/evcdec: set the demuxer as AVFMT_NOTIMESTAMPS James Almer
2023-06-15 15:18 ` [FFmpeg-devel] [PATCH 02/11] avcodec/evc_parser: remove superfluous memset calls James Almer
2023-06-15 15:19   ` Paul B Mahol
2023-06-15 15:18 ` James Almer [this message]
2023-06-15 15:18 ` [FFmpeg-devel] [PATCH 04/11] avcodec/evc_parse: zero sps, pps and sh structs James Almer
2023-06-15 15:18 ` [FFmpeg-devel] [PATCH 05/11] avcodec/evc_parse: use a local EVCParserSliceHeader when parsing slices James Almer
2023-06-15 15:18 ` [FFmpeg-devel] [PATCH 06/11] avcodec/evc_parse: use the correct struct size when allocating pps James Almer
2023-06-15 15:20   ` Paul B Mahol
2023-06-15 15:18 ` [FFmpeg-devel] [PATCH 07/11] avcodec/evc_parse: use the correct sps when parsing slice headers James Almer
2023-06-15 15:18 ` [FFmpeg-devel] [PATCH 08/11] avcodec/evc_parse: free pps struct on parsing failure James Almer
2023-06-15 15:18 ` [FFmpeg-devel] [PATCH 09/11] avcodec/evc_parse: make freeing EVCParserContext buffers a shared function James Almer
2023-06-15 15:18 ` [FFmpeg-devel] [PATCH 10/11] avcodec/evc_frame_merge_bsf: ceck for av_memdup() failure James Almer
2023-06-15 15:18 ` [FFmpeg-devel] [PATCH 11/11] avcodec/evc_frame_merge_bsf: free EVCFMergeContext on flush and close James Almer
2023-06-16 18:07 ` [FFmpeg-devel] [PATCH 01/11] avformat/evcdec: set the demuxer as AVFMT_NOTIMESTAMPS James Almer

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=20230615151836.50535-3-jamrial@gmail.com \
    --to=jamrial@gmail.com \
    --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