Skip to content

Commit 225d3bd

Browse files
authored
Improve codestyle
Bump to v15
1 parent 4937037 commit 225d3bd

File tree

3 files changed

+23
-23
lines changed

3 files changed

+23
-23
lines changed

imf-prepare-patches.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
set -e
44

5-
PATCH_VERSION="14"
5+
PATCH_VERSION="15"
66

77
PATCH_NAME="avformat/imf"
88

libavformat/imf_cpl.c

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -246,14 +246,14 @@ static int fill_base_resource(xmlNodePtr resource_elem, FFIMFBaseResource *resou
246246
/* read EditRate */
247247
if (!(element = ff_imf_xml_get_child_element_by_name(resource_elem, "EditRate"))) {
248248
resource->edit_rate = cpl->edit_rate;
249-
} else if (ret = ff_imf_xml_read_rational(element, &resource->edit_rate)) {
249+
} else if ((ret = ff_imf_xml_read_rational(element, &resource->edit_rate))) {
250250
av_log(NULL, AV_LOG_ERROR, "Invalid EditRate element found in a Resource\n");
251251
return ret;
252252
}
253253

254254
/* read EntryPoint */
255-
if (element = ff_imf_xml_get_child_element_by_name(resource_elem, "EntryPoint")) {
256-
if (ret = ff_imf_xml_read_uint32(element, &resource->entry_point)) {
255+
if ((element = ff_imf_xml_get_child_element_by_name(resource_elem, "EntryPoint"))) {
256+
if ((ret = ff_imf_xml_read_uint32(element, &resource->entry_point))) {
257257
av_log(NULL, AV_LOG_ERROR, "Invalid EntryPoint element found in a Resource\n");
258258
return ret;
259259
}
@@ -266,22 +266,22 @@ static int fill_base_resource(xmlNodePtr resource_elem, FFIMFBaseResource *resou
266266
av_log(NULL, AV_LOG_ERROR, "IntrinsicDuration element missing from Resource\n");
267267
return AVERROR_INVALIDDATA;
268268
}
269-
if (ret = ff_imf_xml_read_uint32(element, &resource->duration)) {
269+
if ((ret = ff_imf_xml_read_uint32(element, &resource->duration))) {
270270
av_log(NULL, AV_LOG_ERROR, "Invalid IntrinsicDuration element found in a Resource\n");
271271
return ret;
272272
}
273273
resource->duration -= resource->entry_point;
274274

275275
/* read SourceDuration */
276-
if (element = ff_imf_xml_get_child_element_by_name(resource_elem, "SourceDuration")) {
277-
if (ret = ff_imf_xml_read_uint32(element, &resource->duration)) {
276+
if ((element = ff_imf_xml_get_child_element_by_name(resource_elem, "SourceDuration"))) {
277+
if ((ret = ff_imf_xml_read_uint32(element, &resource->duration))) {
278278
av_log(NULL, AV_LOG_ERROR, "SourceDuration element missing from Resource\n");
279279
return ret;
280280
}
281281
}
282282

283283
/* read RepeatCount */
284-
if (element = ff_imf_xml_get_child_element_by_name(resource_elem, "RepeatCount"))
284+
if ((element = ff_imf_xml_get_child_element_by_name(resource_elem, "RepeatCount")))
285285
ret = ff_imf_xml_read_uint32(element, &resource->repeat_count);
286286

287287
return ret;
@@ -294,12 +294,12 @@ static int fill_trackfile_resource(xmlNodePtr tf_resource_elem,
294294
xmlNodePtr element = NULL;
295295
int ret = 0;
296296

297-
if (ret = fill_base_resource(tf_resource_elem, (FFIMFBaseResource *)tf_resource, cpl))
297+
if ((ret = fill_base_resource(tf_resource_elem, (FFIMFBaseResource *)tf_resource, cpl)))
298298
return ret;
299299

300300
/* read TrackFileId */
301-
if (element = ff_imf_xml_get_child_element_by_name(tf_resource_elem, "TrackFileId")) {
302-
if (ret = ff_imf_xml_read_uuid(element, tf_resource->track_file_uuid)) {
301+
if ((element = ff_imf_xml_get_child_element_by_name(tf_resource_elem, "TrackFileId"))) {
302+
if ((ret = ff_imf_xml_read_uuid(element, tf_resource->track_file_uuid))) {
303303
av_log(NULL, AV_LOG_ERROR, "Invalid TrackFileId element found in Resource\n");
304304
return ret;
305305
}
@@ -318,7 +318,7 @@ static int fill_marker_resource(xmlNodePtr marker_resource_elem,
318318
xmlNodePtr element = NULL;
319319
int ret = 0;
320320

321-
if (ret = fill_base_resource(marker_resource_elem, (FFIMFBaseResource *)marker_resource, cpl))
321+
if ((ret = fill_base_resource(marker_resource_elem, (FFIMFBaseResource *)marker_resource, cpl)))
322322
return ret;
323323

324324
/* read markers */
@@ -365,7 +365,7 @@ static int push_marker_sequence(xmlNodePtr marker_sequence_elem, FFIMFCPL *cpl)
365365
av_log(NULL, AV_LOG_ERROR, "TrackId element missing from Sequence\n");
366366
return AVERROR_INVALIDDATA;
367367
}
368-
if (ret = ff_imf_xml_read_uuid(track_id_elem, uuid)) {
368+
if (ff_imf_xml_read_uuid(track_id_elem, uuid)) {
369369
av_log(NULL, AV_LOG_ERROR, "Invalid TrackId element found in Sequence\n");
370370
return AVERROR_INVALIDDATA;
371371
}
@@ -453,7 +453,7 @@ static int push_main_audio_sequence(xmlNodePtr audio_sequence_elem, FFIMFCPL *cp
453453
av_log(NULL, AV_LOG_ERROR, "TrackId element missing from audio sequence\n");
454454
return AVERROR_INVALIDDATA;
455455
}
456-
if (ret = ff_imf_xml_read_uuid(track_id_elem, uuid)) {
456+
if ((ret = ff_imf_xml_read_uuid(track_id_elem, uuid))) {
457457
av_log(NULL, AV_LOG_ERROR, "Invalid TrackId element found in audio sequence\n");
458458
return ret;
459459
}
@@ -545,7 +545,7 @@ static int push_main_image_2d_sequence(xmlNodePtr image_sequence_elem, FFIMFCPL
545545
av_log(NULL, AV_LOG_ERROR, "TrackId element missing from audio sequence\n");
546546
return AVERROR_INVALIDDATA;
547547
}
548-
if (ret = ff_imf_xml_read_uuid(track_id_elem, uuid)) {
548+
if ((ret = ff_imf_xml_read_uuid(track_id_elem, uuid))) {
549549
av_log(NULL, AV_LOG_ERROR, "Invalid TrackId element found in audio sequence\n");
550550
return ret;
551551
}
@@ -677,13 +677,13 @@ int ff_imf_parse_cpl_from_xml_dom(xmlDocPtr doc, FFIMFCPL **cpl)
677677
goto cleanup;
678678
}
679679

680-
if (ret = fill_content_title(cpl_element, *cpl))
680+
if ((ret = fill_content_title(cpl_element, *cpl)))
681681
goto cleanup;
682-
if (ret = fill_id(cpl_element, *cpl))
682+
if ((ret = fill_id(cpl_element, *cpl)))
683683
goto cleanup;
684-
if (ret = fill_edit_rate(cpl_element, *cpl))
684+
if ((ret = fill_edit_rate(cpl_element, *cpl)))
685685
goto cleanup;
686-
if (ret = fill_virtual_tracks(cpl_element, *cpl))
686+
if ((ret = fill_virtual_tracks(cpl_element, *cpl)))
687687
goto cleanup;
688688

689689
cleanup:
@@ -802,7 +802,7 @@ int ff_imf_parse_cpl(AVIOContext *in, FFIMFCPL **cpl)
802802
ret = AVERROR_INVALIDDATA;
803803
}
804804

805-
if (ret = ff_imf_parse_cpl_from_xml_dom(doc, cpl)) {
805+
if ((ret = ff_imf_parse_cpl_from_xml_dom(doc, cpl))) {
806806
av_log(NULL, AV_LOG_ERROR, "Cannot parse IMF CPL\n");
807807
} else {
808808
av_log(NULL,

libavformat/imfdec.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ static int open_track_resource_context(AVFormatContext *s,
352352
if ((ret = ff_copy_whiteblacklists(track_resource->ctx, s)) < 0)
353353
goto cleanup;
354354

355-
if (ret = av_opt_set(track_resource->ctx, "format_whitelist", "mxf", 0))
355+
if ((ret = av_opt_set(track_resource->ctx, "format_whitelist", "mxf", 0)))
356356
goto cleanup;
357357

358358
if ((ret = av_dict_copy(&opts, c->avio_opts, 0)) < 0)
@@ -638,15 +638,15 @@ static int imf_read_header(AVFormatContext *s)
638638
while (asset_map_path != NULL) {
639639
av_log(s, AV_LOG_DEBUG, "start parsing IMF Asset Map: %s\n", asset_map_path);
640640

641-
if (ret = parse_assetmap(s, asset_map_path))
641+
if ((ret = parse_assetmap(s, asset_map_path)))
642642
return ret;
643643

644644
asset_map_path = av_strtok(NULL, ",", &tmp_str);
645645
}
646646

647647
av_log(s, AV_LOG_DEBUG, "parsed IMF Asset Maps\n");
648648

649-
if (ret = open_cpl_tracks(s))
649+
if ((ret = open_cpl_tracks(s)))
650650
return ret;
651651

652652
av_log(s, AV_LOG_DEBUG, "parsed IMF package\n");

0 commit comments

Comments
 (0)