Skip to content

Commit d52f2c2

Browse files
committed
Futher style improvements
1 parent ed2c82e commit d52f2c2

File tree

3 files changed

+40
-49
lines changed

3 files changed

+40
-49
lines changed

libavformat/imf.h

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -73,36 +73,36 @@ typedef uint8_t FFIMFUUID[16];
7373
* IMF Composition Playlist Base Resource
7474
*/
7575
typedef struct FFIMFBaseResource {
76-
AVRational edit_rate; /**< BaseResourceType/EditRate */
77-
uint32_t entry_point; /**< BaseResourceType/EntryPoint */
78-
uint32_t duration; /**< BaseResourceType/Duration */
79-
uint32_t repeat_count; /**< BaseResourceType/RepeatCount */
76+
AVRational edit_rate; /**< BaseResourceType/EditRate */
77+
uint32_t entry_point; /**< BaseResourceType/EntryPoint */
78+
uint32_t duration; /**< BaseResourceType/Duration */
79+
uint32_t repeat_count; /**< BaseResourceType/RepeatCount */
8080
} FFIMFBaseResource;
8181

8282
/**
8383
* IMF Composition Playlist Track File Resource
8484
*/
8585
typedef struct FFIMFTrackFileResource {
8686
FFIMFBaseResource base;
87-
FFIMFUUID track_file_uuid; /**< TrackFileResourceType/TrackFileId */
87+
FFIMFUUID track_file_uuid; /**< TrackFileResourceType/TrackFileId */
8888
} FFIMFTrackFileResource;
8989

9090
/**
9191
* IMF Marker
9292
*/
9393
typedef struct FFIMFMarker {
94-
xmlChar *label_utf8; /**< Marker/Label */
95-
xmlChar *scope_utf8; /**< Marker/Label/\@scope */
96-
uint32_t offset; /**< Marker/Offset */
94+
xmlChar *label_utf8; /**< Marker/Label */
95+
xmlChar *scope_utf8; /**< Marker/Label/\@scope */
96+
uint32_t offset; /**< Marker/Offset */
9797
} FFIMFMarker;
9898

9999
/**
100100
* IMF Composition Playlist Marker Resource
101101
*/
102102
typedef struct FFIMFMarkerResource {
103103
FFIMFBaseResource base;
104-
uint32_t marker_count; /**< Number of Marker elements */
105-
FFIMFMarker *markers; /**< Marker elements */
104+
uint32_t marker_count; /**< Number of Marker elements */
105+
FFIMFMarker *markers; /**< Marker elements */
106106
} FFIMFMarkerResource;
107107

108108
/**
@@ -116,32 +116,32 @@ typedef struct FFIMFBaseVirtualTrack {
116116
* IMF Composition Playlist Virtual Track that consists of Track File Resources
117117
*/
118118
typedef struct FFIMFTrackFileVirtualTrack {
119-
FFIMFBaseVirtualTrack base;
120-
uint32_t resource_count; /**< Number of Resource elements present in the Virtual Track */
121-
FFIMFTrackFileResource *resources; /**< Resource elements of the Virtual Track */
122-
unsigned int resources_alloc_sz; /**< Size of the resources buffer */
119+
FFIMFBaseVirtualTrack base;
120+
uint32_t resource_count; /**< Number of Resource elements present in the Virtual Track */
121+
FFIMFTrackFileResource *resources; /**< Resource elements of the Virtual Track */
122+
unsigned int resources_alloc_sz; /**< Size of the resources buffer */
123123
} FFIMFTrackFileVirtualTrack;
124124

125125
/**
126126
* IMF Composition Playlist Virtual Track that consists of Marker Resources
127127
*/
128128
typedef struct FFIMFMarkerVirtualTrack {
129129
FFIMFBaseVirtualTrack base;
130-
uint32_t resource_count; /**< Number of Resource elements present in the Virtual Track */
131-
FFIMFMarkerResource *resources; /**< Resource elements of the Virtual Track */
130+
uint32_t resource_count; /**< Number of Resource elements present in the Virtual Track */
131+
FFIMFMarkerResource *resources; /**< Resource elements of the Virtual Track */
132132
} FFIMFMarkerVirtualTrack;
133133

134134
/**
135135
* IMF Composition Playlist
136136
*/
137137
typedef struct FFIMFCPL {
138-
FFIMFUUID id_uuid; /**< CompositionPlaylist/Id element */
139-
xmlChar *content_title_utf8; /**< CompositionPlaylist/ContentTitle element */
140-
AVRational edit_rate; /**< CompositionPlaylist/EditRate element */
141-
FFIMFMarkerVirtualTrack *main_markers_track; /**< Main Marker Virtual Track */
142-
FFIMFTrackFileVirtualTrack *main_image_2d_track; /**< Main Image Virtual Track */
143-
uint32_t main_audio_track_count; /**< Number of Main Audio Virtual Tracks */
144-
FFIMFTrackFileVirtualTrack *main_audio_tracks; /**< Main Audio Virtual Tracks */
138+
FFIMFUUID id_uuid; /**< CompositionPlaylist/Id element */
139+
xmlChar *content_title_utf8; /**< CompositionPlaylist/ContentTitle element */
140+
AVRational edit_rate; /**< CompositionPlaylist/EditRate element */
141+
FFIMFMarkerVirtualTrack *main_markers_track; /**< Main Marker Virtual Track */
142+
FFIMFTrackFileVirtualTrack *main_image_2d_track; /**< Main Image Virtual Track */
143+
uint32_t main_audio_track_count; /**< Number of Main Audio Virtual Tracks */
144+
FFIMFTrackFileVirtualTrack *main_audio_tracks; /**< Main Audio Virtual Tracks */
145145
} FFIMFCPL;
146146

147147
/**

libavformat/imfdec.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
*/
8484
typedef struct IMFAssetLocator {
8585
FFIMFUUID uuid;
86-
char *absolute_uri;
86+
char *absolute_uri;
8787
} IMFAssetLocator;
8888

8989
/**
@@ -644,12 +644,9 @@ static IMFVirtualTrackPlaybackCtx *get_next_track_with_minimum_timestamp(AVForma
644644
for (uint32_t i = c->track_count; i > 0; i--) {
645645
av_log(s, AV_LOG_DEBUG,
646646
"Compare track %d timestamp " AVRATIONAL_FORMAT
647-
" to minimum " AVRATIONAL_FORMAT
648-
" (over duration: " AVRATIONAL_FORMAT
649-
")\n", i,
650-
AVRATIONAL_ARG(c->tracks[i - 1]->current_timestamp),
651-
AVRATIONAL_ARG(minimum_timestamp),
652-
AVRATIONAL_ARG(c->tracks[i - 1]->duration));
647+
" to minimum " AVRATIONAL_FORMAT " (over duration: " AVRATIONAL_FORMAT ")\n",
648+
i, AVRATIONAL_ARG(c->tracks[i - 1]->current_timestamp),
649+
AVRATIONAL_ARG(minimum_timestamp), AVRATIONAL_ARG(c->tracks[i - 1]->duration));
653650

654651
if (av_cmp_q(c->tracks[i - 1]->current_timestamp, minimum_timestamp) <= 0) {
655652
track = c->tracks[i - 1];

libavformat/tests/imf.c

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -452,17 +452,17 @@ typedef struct PathTypeTestStruct {
452452
} PathTypeTestStruct;
453453

454454
static const PathTypeTestStruct PATH_TYPE_TEST_STRUCTS[11] = {
455-
{.path = "file://path/to/somewhere", .is_url = 1, .is_unix_absolute_path = 0, .is_dos_absolute_path = 0},
456-
{.path = "http://path/to/somewhere", .is_url = 1, .is_unix_absolute_path = 0, .is_dos_absolute_path = 0},
455+
{.path = "file://path/to/somewhere", .is_url = 1, .is_unix_absolute_path = 0, .is_dos_absolute_path = 0},
456+
{.path = "http://path/to/somewhere", .is_url = 1, .is_unix_absolute_path = 0, .is_dos_absolute_path = 0},
457457
{.path = "https://path/to/somewhere", .is_url = 1, .is_unix_absolute_path = 0, .is_dos_absolute_path = 0},
458-
{.path = "s3://path/to/somewhere", .is_url = 1, .is_unix_absolute_path = 0, .is_dos_absolute_path = 0},
459-
{.path = "ftp://path/to/somewhere", .is_url = 1, .is_unix_absolute_path = 0, .is_dos_absolute_path = 0},
460-
{.path = "/path/to/somewhere", .is_url = 0, .is_unix_absolute_path = 1, .is_dos_absolute_path = 0},
461-
{.path = "path/to/somewhere", .is_url = 0, .is_unix_absolute_path = 0, .is_dos_absolute_path = 0},
462-
{.path = "C:\\path\\to\\somewhere", .is_url = 0, .is_unix_absolute_path = 0, .is_dos_absolute_path = 1},
463-
{.path = "C:/path/to/somewhere", .is_url = 0, .is_unix_absolute_path = 0, .is_dos_absolute_path = 1},
464-
{.path = "\\\\path\\to\\somewhere", .is_url = 0, .is_unix_absolute_path = 0, .is_dos_absolute_path = 1},
465-
{.path = "path\\to\\somewhere", .is_url = 0, .is_unix_absolute_path = 0, .is_dos_absolute_path = 0},
458+
{.path = "s3://path/to/somewhere", .is_url = 1, .is_unix_absolute_path = 0, .is_dos_absolute_path = 0},
459+
{.path = "ftp://path/to/somewhere", .is_url = 1, .is_unix_absolute_path = 0, .is_dos_absolute_path = 0},
460+
{.path = "/path/to/somewhere", .is_url = 0, .is_unix_absolute_path = 1, .is_dos_absolute_path = 0},
461+
{.path = "path/to/somewhere", .is_url = 0, .is_unix_absolute_path = 0, .is_dos_absolute_path = 0},
462+
{.path = "C:\\path\\to\\somewhere", .is_url = 0, .is_unix_absolute_path = 0, .is_dos_absolute_path = 1},
463+
{.path = "C:/path/to/somewhere", .is_url = 0, .is_unix_absolute_path = 0, .is_dos_absolute_path = 1},
464+
{.path = "\\\\path\\to\\somewhere", .is_url = 0, .is_unix_absolute_path = 0, .is_dos_absolute_path = 1},
465+
{.path = "path\\to\\somewhere", .is_url = 0, .is_unix_absolute_path = 0, .is_dos_absolute_path = 0},
466466
};
467467

468468
static int test_path_type_functions(void)
@@ -473,27 +473,21 @@ static int test_path_type_functions(void)
473473
if (imf_uri_is_url(path_type.path) != path_type.is_url) {
474474
fprintf(stderr,
475475
"URL comparison test failed for '%s', got %d instead of expected %d\n",
476-
path_type.path,
477-
path_type.is_url,
478-
!path_type.is_url);
476+
path_type.path, path_type.is_url, !path_type.is_url);
479477
goto fail;
480478
}
481479

482480
if (imf_uri_is_unix_abs_path(path_type.path) != path_type.is_unix_absolute_path) {
483481
fprintf(stderr,
484482
"Unix absolute path comparison test failed for '%s', got %d instead of expected %d\n",
485-
path_type.path,
486-
path_type.is_unix_absolute_path,
487-
!path_type.is_unix_absolute_path);
483+
path_type.path, path_type.is_unix_absolute_path, !path_type.is_unix_absolute_path);
488484
goto fail;
489485
}
490486

491487
if (imf_uri_is_dos_abs_path(path_type.path) != path_type.is_dos_absolute_path) {
492488
fprintf(stderr,
493489
"DOS absolute path comparison test failed for '%s', got %d instead of expected %d\n",
494-
path_type.path,
495-
path_type.is_dos_absolute_path,
496-
!path_type.is_dos_absolute_path);
490+
path_type.path, path_type.is_dos_absolute_path, !path_type.is_dos_absolute_path);
497491
goto fail;
498492
}
499493
}

0 commit comments

Comments
 (0)