MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / set_codec_str

Function set_codec_str

tools/sidxindex.c:56–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

54};
55
56static void set_codec_str(AVCodecParameters *codecpar, char *str, int size)
57{
58 switch (codecpar->codec_id) {
59 case AV_CODEC_ID_H264:
60 snprintf(str, size, "avc1");
61 if (codecpar->extradata_size >= 4 && codecpar->extradata[0] == 1) {
62 av_strlcatf(str, size, ".%02x%02x%02x",
63 codecpar->extradata[1], codecpar->extradata[2],
64 codecpar->extradata[3]);
65 }
66 break;
67 case AV_CODEC_ID_AAC:
68 snprintf(str, size, "mp4a.40"); // 0x40 is the mp4 object type for AAC
69 if (codecpar->extradata_size >= 2) {
70 int aot = codecpar->extradata[0] >> 3;
71 if (aot == 31)
72 aot = ((AV_RB16(codecpar->extradata) >> 5) & 0x3f) + 32;
73 av_strlcatf(str, size, ".%d", aot);
74 }
75 break;
76 }
77}
78
79static int find_sidx(struct Tracks *tracks, int start_index,
80 const char *file)

Callers 1

handle_fileFunction · 0.85

Calls 1

av_strlcatfFunction · 0.85

Tested by

no test coverage detected