mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-02-19 21:36:54 +00:00
avfilter/vf_showinfo: limit the max number of timecode
Signed-off-by: Limin Wang <lance.lmwang@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
4976b102d8
commit
585ac1ff5b
@ -318,14 +318,15 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
|
|||||||
break;
|
break;
|
||||||
case AV_FRAME_DATA_S12M_TIMECODE: {
|
case AV_FRAME_DATA_S12M_TIMECODE: {
|
||||||
uint32_t *tc = (uint32_t*)sd->data;
|
uint32_t *tc = (uint32_t*)sd->data;
|
||||||
|
int m = FFMIN(tc[0],3);
|
||||||
if (sd->size != 16) {
|
if (sd->size != 16) {
|
||||||
av_log(ctx, AV_LOG_ERROR, "invalid data");
|
av_log(ctx, AV_LOG_ERROR, "invalid data");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
for (int j = 1; j <= tc[0]; j++) {
|
for (int j = 1; j <= m; j++) {
|
||||||
char tcbuf[AV_TIMECODE_STR_SIZE];
|
char tcbuf[AV_TIMECODE_STR_SIZE];
|
||||||
av_timecode_make_smpte_tc_string(tcbuf, tc[j], 0);
|
av_timecode_make_smpte_tc_string(tcbuf, tc[j], 0);
|
||||||
av_log(ctx, AV_LOG_INFO, "timecode - %s%s", tcbuf, j != tc[0] ? ", " : "");
|
av_log(ctx, AV_LOG_INFO, "timecode - %s%s", tcbuf, j != m ? ", " : "");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user