diff mbox series

[FFmpeg-devel,6/8] avcodec: use av_timecode_make_smpte_tc_string2 in hevc and h264 decoder

Message ID 20200905182217.28037-6-cus@passwd.hu
State Accepted
Commit 5673802511e68d2b7ba2c8840e3efcc44aaf9f10
Headers show
Series [FFmpeg-devel,1/8] avutil/timecode: fix av_timecode_get_smpte_from_framenum with 50/60 fps | expand

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Marton Balint Sept. 5, 2020, 6:22 p.m. UTC
Signed-off-by: Marton Balint <cus@passwd.hu>
---
 libavcodec/h264_slice.c | 2 +-
 libavcodec/hevcdec.c    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

Lance Wang Sept. 6, 2020, 1:48 p.m. UTC | #1
On Sat, Sep 05, 2020 at 08:22:15PM +0200, Marton Balint wrote:
> Signed-off-by: Marton Balint <cus@passwd.hu>
> ---
>  libavcodec/h264_slice.c | 2 +-
>  libavcodec/hevcdec.c    | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
> index c7b2764270..cfc29e186c 100644
> --- a/libavcodec/h264_slice.c
> +++ b/libavcodec/h264_slice.c
> @@ -1325,7 +1325,7 @@ static int h264_export_frame_props(H264Context *h)
>              int   ff = h->sei.picture_timing.timecode[i].frame;
>  
>              tc_sd[i + 1] = av_timecode_get_smpte(h->avctx->framerate, drop, hh, mm, ss, ff);
> -            av_timecode_make_smpte_tc_string(tcbuf, tc_sd[i + 1], 0);
> +            av_timecode_make_smpte_tc_string2(tcbuf, h->avctx->framerate, tc_sd[i + 1], 0, 0);
>              av_dict_set(&out->metadata, "timecode", tcbuf, 0);
>          }
>          h->sei.picture_timing.timecode_cnt = 0;
> diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c
> index b77df8d89f..c1de75abe1 100644
> --- a/libavcodec/hevcdec.c
> +++ b/libavcodec/hevcdec.c
> @@ -2843,7 +2843,7 @@ static int set_side_data(HEVCContext *s)
>              int   ff = s->sei.timecode.n_frames[i];
>  
>              tc_sd[i + 1] = av_timecode_get_smpte(s->avctx->framerate, drop, hh, mm, ss, ff);
> -            av_timecode_make_smpte_tc_string(tcbuf, tc_sd[i + 1], 0);
> +            av_timecode_make_smpte_tc_string2(tcbuf, s->avctx->framerate, tc_sd[i + 1], 0, 0);
>              av_dict_set(&out->metadata, "timecode", tcbuf, 0);
>          }
>  

have tested with 50fps timecode sample and the result looks good now.

> -- 
> 2.26.2
> 
> _______________________________________________
> 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".
diff mbox series

Patch

diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
index c7b2764270..cfc29e186c 100644
--- a/libavcodec/h264_slice.c
+++ b/libavcodec/h264_slice.c
@@ -1325,7 +1325,7 @@  static int h264_export_frame_props(H264Context *h)
             int   ff = h->sei.picture_timing.timecode[i].frame;
 
             tc_sd[i + 1] = av_timecode_get_smpte(h->avctx->framerate, drop, hh, mm, ss, ff);
-            av_timecode_make_smpte_tc_string(tcbuf, tc_sd[i + 1], 0);
+            av_timecode_make_smpte_tc_string2(tcbuf, h->avctx->framerate, tc_sd[i + 1], 0, 0);
             av_dict_set(&out->metadata, "timecode", tcbuf, 0);
         }
         h->sei.picture_timing.timecode_cnt = 0;
diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c
index b77df8d89f..c1de75abe1 100644
--- a/libavcodec/hevcdec.c
+++ b/libavcodec/hevcdec.c
@@ -2843,7 +2843,7 @@  static int set_side_data(HEVCContext *s)
             int   ff = s->sei.timecode.n_frames[i];
 
             tc_sd[i + 1] = av_timecode_get_smpte(s->avctx->framerate, drop, hh, mm, ss, ff);
-            av_timecode_make_smpte_tc_string(tcbuf, tc_sd[i + 1], 0);
+            av_timecode_make_smpte_tc_string2(tcbuf, s->avctx->framerate, tc_sd[i + 1], 0, 0);
             av_dict_set(&out->metadata, "timecode", tcbuf, 0);
         }