History

avformat/matroska: use named constants for ITU-T T.35 metadata

James Almer committed 2 years ago

Commit 53dd3141 parent 61519cc2 files · +6 −3Browse files

Unified · Split

2 files
  1. libavformat/matroskadec.c +3 −1
  2. libavformat/matroskaenc.c +3 −2
libavformat/matroskadec.c+3−1
@@ -54,6 +54,7 @@ · 53 unmodified lines
5454 #include "libavcodec/bytestream.h"
5555 #include "libavcodec/defs.h"
5656 #include "libavcodec/flac.h"
57+#include "libavcodec/itut35.h"
5758 #include "libavcodec/mpeg4audio.h"
5859 #include "libavcodec/packet_internal.h"
5960
@@ -3884,7 +3885,8 @@ static int matroska_parse_block_additional(MatroskaDemuxContext *matroska, · 3824 unmodified lines
38843885 country_code = bytestream2_get_byteu(&bc);
38853886 provider_code = bytestream2_get_be16u(&bc);
38863887
3887− if (country_code != 0xB5 || provider_code != 0x3C)
3888+ if (country_code != ITU_T_T35_COUNTRY_CODE_US ||
3889+ provider_code != ITU_T_T35_PROVIDER_CODE_SMTPE)
38883890 break; // ignore
38893891
38903892 provider_oriented_code = bytestream2_get_be16u(&bc);
libavformat/matroskaenc.c+3−2
@@ -63,6 +63,7 @@ · 62 unmodified lines
6363 #include "libavcodec/codec_desc.h"
6464 #include "libavcodec/codec_par.h"
6565 #include "libavcodec/defs.h"
66+#include "libavcodec/itut35.h"
6667 #include "libavcodec/xiph.h"
6768 #include "libavcodec/mpeg4audio.h"
6869
@@ -2824,8 +2825,8 @@ static int mkv_write_block(void *logctx, MatroskaMuxContext *mkv, · 2755 unmodified lines
28242825 uint8_t *payload = t35_buf;
28252826 size_t payload_size = sizeof(t35_buf) - 6;
28262827
2827− bytestream_put_byte(&payload, 0xB5); // country_code
2828− bytestream_put_be16(&payload, 0x3C); // provider_code
2828+ bytestream_put_byte(&payload, ITU_T_T35_COUNTRY_CODE_US);
2829+ bytestream_put_be16(&payload, ITU_T_T35_PROVIDER_CODE_SMTPE);
28292830 bytestream_put_be16(&payload, 0x01); // provider_oriented_code
28302831 bytestream_put_byte(&payload, 0x04); // application_identifier
28312832

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t