Skip to content

Commit 88a8dc7

Browse files
committed
avformat/segment: Indent and whitespace fixes
Signed-off-by: softworkz <softworkz@hotmail.com>
1 parent 1348b1b commit 88a8dc7

File tree

1 file changed

+23
-25
lines changed

1 file changed

+23
-25
lines changed

libavformat/segment.c

Lines changed: 23 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ static int segment_mux_init(AVFormatContext *s)
177177
return AVERROR(ENOMEM);
178178
opar = st->codecpar;
179179
if (!oc->oformat->codec_tag ||
180-
av_codec_get_id (oc->oformat->codec_tag, ipar->codec_tag) == opar->codec_id ||
180+
av_codec_get_id(oc->oformat->codec_tag, ipar->codec_tag) == opar->codec_id ||
181181
av_codec_get_tag(oc->oformat->codec_tag, ipar->codec_id) <= 0) {
182182
opar->codec_tag = ipar->codec_tag;
183183
} else {
@@ -340,17 +340,17 @@ static void segment_list_print_entry(AVIOContext *list_ioctx,
340340
list_entry->end_time - list_entry->start_time, list_entry->filename);
341341
break;
342342
case LIST_TYPE_FFCONCAT:
343-
{
344-
char *buf;
345-
if (av_escape(&buf, list_entry->filename, NULL, AV_ESCAPE_MODE_AUTO, AV_ESCAPE_FLAG_WHITESPACE) < 0) {
346-
av_log(log_ctx, AV_LOG_WARNING,
347-
"Error writing list entry '%s' in list file\n", list_entry->filename);
348-
return;
343+
{
344+
char *buf;
345+
if (av_escape(&buf, list_entry->filename, NULL, AV_ESCAPE_MODE_AUTO, AV_ESCAPE_FLAG_WHITESPACE) < 0) {
346+
av_log(log_ctx, AV_LOG_WARNING,
347+
"Error writing list entry '%s' in list file\n", list_entry->filename);
348+
return;
349+
}
350+
avio_printf(list_ioctx, "file %s\n", buf);
351+
av_free(buf);
352+
break;
349353
}
350-
avio_printf(list_ioctx, "file %s\n", buf);
351-
av_free(buf);
352-
break;
353-
}
354354
default:
355355
av_assert0(!"Invalid list type");
356356
}
@@ -456,8 +456,8 @@ static int segment_end(AVFormatContext *s, int write_trailer, int is_last)
456456
av_log(s, AV_LOG_WARNING, "Could not increment stream %d timecode, error occurred during timecode creation.\n", i);
457457
continue;
458458
}
459-
st_tc.start += (int)((seg->cur_entry.end_time - seg->cur_entry.start_time) * av_q2d(st_rate)); // increment timecode
460-
av_dict_set(&s->streams[i]->metadata, "timecode", av_timecode_make_string(&st_tc, st_buf, 0), 0);
459+
st_tc.start += (int)((seg->cur_entry.end_time - seg->cur_entry.start_time) * av_q2d(st_rate)); // increment timecode
460+
av_dict_set(&s->streams[i]->metadata, "timecode", av_timecode_make_string(&st_tc, st_buf, 0), 0);
461461
}
462462
}
463463
}
@@ -755,8 +755,8 @@ static int seg_init(AVFormatContext *s)
755755

756756
if (seg->list) {
757757
if (seg->list_type == LIST_TYPE_UNDEFINED) {
758-
if (av_match_ext(seg->list, "csv" )) seg->list_type = LIST_TYPE_CSV;
759-
else if (av_match_ext(seg->list, "ext" )) seg->list_type = LIST_TYPE_EXT;
758+
if (av_match_ext(seg->list, "csv")) seg->list_type = LIST_TYPE_CSV;
759+
else if (av_match_ext(seg->list, "ext")) seg->list_type = LIST_TYPE_EXT;
760760
else if (av_match_ext(seg->list, "m3u8")) seg->list_type = LIST_TYPE_M3U8;
761761
else if (av_match_ext(seg->list, "ffcat,ffconcat")) seg->list_type = LIST_TYPE_FFCONCAT;
762762
else seg->list_type = LIST_TYPE_FLAT;
@@ -911,11 +911,9 @@ static int seg_write_packet(AVFormatContext *s, AVPacket *pkt)
911911

912912
calc_times:
913913
if (seg->times) {
914-
end_pts = seg->segment_count < seg->nb_times ?
915-
seg->times[seg->segment_count] : INT64_MAX;
914+
end_pts = seg->segment_count < seg->nb_times ? seg->times[seg->segment_count] : INT64_MAX;
916915
} else if (seg->frames) {
917-
start_frame = seg->segment_count < seg->nb_frames ?
918-
seg->frames[seg->segment_count] : INT_MAX;
916+
start_frame = seg->segment_count < seg->nb_frames ? seg->frames[seg->segment_count] : INT_MAX;
919917
} else {
920918
if (seg->use_clocktime) {
921919
int64_t avgt = av_gettime();
@@ -956,10 +954,10 @@ static int seg_write_packet(AVFormatContext *s, AVPacket *pkt)
956954
(pkt->flags & AV_PKT_FLAG_KEY || seg->break_non_keyframes) &&
957955
(seg->segment_frame_count > 0 || seg->write_empty) &&
958956
(seg->cut_pending || seg->frame_count >= start_frame ||
959-
(pkt->pts != AV_NOPTS_VALUE &&
960-
pkt_pts_avtb - seg->cur_entry.start_pts >= seg->min_seg_duration &&
961-
av_compare_ts(pkt->pts, st->time_base,
962-
end_pts - seg->time_delta, AV_TIME_BASE_Q) >= 0))) {
957+
(pkt->pts != AV_NOPTS_VALUE &&
958+
pkt_pts_avtb - seg->cur_entry.start_pts >= seg->min_seg_duration &&
959+
av_compare_ts(pkt->pts, st->time_base,
960+
end_pts - seg->time_delta, AV_TIME_BASE_Q) >= 0))) {
963961
/* sanitize end time in case last packet didn't have a defined duration */
964962
if (seg->cur_entry.last_duration == 0)
965963
seg->cur_entry.end_time = (double)pkt->pts * av_q2d(st->time_base);
@@ -1064,8 +1062,8 @@ static int seg_check_bitstream(AVFormatContext *s, AVStream *st,
10641062
if (ret == 1) {
10651063
FFStream *const sti = ffstream(st);
10661064
FFStream *const osti = ffstream(ost);
1067-
sti->bsfc = osti->bsfc;
1068-
osti->bsfc = NULL;
1065+
sti->bsfc = osti->bsfc;
1066+
osti->bsfc = NULL;
10691067
}
10701068
return ret;
10711069
}

0 commit comments

Comments
 (0)