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

Function write_codec_attr

libavformat/hlsenc.c:350–378  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

348}
349
350static void write_codec_attr(AVStream *st, VariantStream *vs)
351{
352 int codec_strlen = strlen(vs->codec_attr);
353 char attr[32];
354 AVBPrint buffer;
355
356 if (st->codecpar->codec_type == AVMEDIA_TYPE_SUBTITLE)
357 return;
358 if (vs->attr_status == CODEC_ATTRIBUTE_WILL_NOT_BE_WRITTEN)
359 return;
360
361 av_bprint_init_for_buffer(&buffer, attr, sizeof(attr));
362 if (ff_make_codec_str(vs->avf, st->codecpar, &st->avg_frame_rate,
363 &buffer) < 0)
364 goto fail;
365
366 // Don't write the same attribute multiple times
367 if (!av_stristr(vs->codec_attr, attr)) {
368 snprintf(vs->codec_attr + codec_strlen,
369 sizeof(vs->codec_attr) - codec_strlen,
370 "%s%s", codec_strlen ? "," : "", attr);
371 }
372 return;
373
374fail:
375 vs->codec_attr[0] = '\0';
376 vs->attr_status = CODEC_ATTRIBUTE_WILL_NOT_BE_WRITTEN;
377 return;
378}
379
380static int replace_str_data_in_filename(char **s, const char *filename, char placeholder, const char *datastring)
381{

Callers 1

hls_write_headerFunction · 0.85

Calls 3

ff_make_codec_strFunction · 0.85
av_stristrFunction · 0.85

Tested by

no test coverage detected