| 348 | } |
| 349 | |
| 350 | static 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 | |
| 374 | fail: |
| 375 | vs->codec_attr[0] = '\0'; |
| 376 | vs->attr_status = CODEC_ATTRIBUTE_WILL_NOT_BE_WRITTEN; |
| 377 | return; |
| 378 | } |
| 379 | |
| 380 | static int replace_str_data_in_filename(char **s, const char *filename, char placeholder, const char *datastring) |
| 381 | { |
no test coverage detected