Skip to content

Commit b230101

Browse files
0p1pp10p1pp1
authored andcommitted
extract title metadata from EIT
but no usecase yet.
1 parent a5a8565 commit b230101

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

libavformat/mpegts.c

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2518,6 +2518,30 @@ static void eit_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
25182518
av_log(ts->stream, AV_LOG_DEBUG, "tag: 0x%02x len=%d\n",
25192519
desc_tag, desc_len);
25202520
switch (desc_tag) {
2521+
case 0x4d: /* short event descriptor */
2522+
{
2523+
int tlen;
2524+
char *title;
2525+
2526+
if (dlen < 5)
2527+
break;
2528+
tlen = *(p + 3);
2529+
if (tlen + 4 > dlen)
2530+
break;
2531+
2532+
title = av_strndup(p + 4, tlen);
2533+
if (!av_strncasecmp(p, "jpn", 3)) {
2534+
char *txt = aribb24_to_utf8(ts->iconv_cd, title, tlen);
2535+
2536+
if (txt) {
2537+
av_free(title);
2538+
title = txt;
2539+
}
2540+
}
2541+
av_dict_set(&program->metadata,
2542+
"title", title, AV_DICT_DONT_STRDUP_VAL);
2543+
}
2544+
break;
25212545
case 0xc4: /* audio component descriptor */
25222546
{
25232547
int comp_tag;

0 commit comments

Comments
 (0)