diff options
author | Clément Bœsch <u@pkh.me> | 2016-02-26 22:15:20 +0100 |
---|---|---|
committer | Clément Bœsch <u@pkh.me> | 2016-02-26 22:15:20 +0100 |
commit | b5451d88cf8b0e165ae357f49254a66828351a56 (patch) | |
tree | b9f5d2927b17883a1114f2059cb0b64fb9587bb4 | |
parent | 22ebbda637257a432c99330ca4c6024665418f0e (diff) | |
download | ffmpeg-b5451d88cf8b0e165ae357f49254a66828351a56.tar.gz |
lavc: reindent a few decoders after previous commits
-rw-r--r-- | libavcodec/movtextenc.c | 7 | ||||
-rw-r--r-- | libavcodec/srtenc.c | 11 | ||||
-rw-r--r-- | libavformat/assenc.c | 81 |
3 files changed, 48 insertions, 51 deletions
diff --git a/libavcodec/movtextenc.c b/libavcodec/movtextenc.c index 791132ae1a..20e01e206e 100644 --- a/libavcodec/movtextenc.c +++ b/libavcodec/movtextenc.c @@ -343,10 +343,9 @@ static int mov_text_encode_frame(AVCodecContext *avctx, unsigned char *buf, if (!strncmp(ass, "Dialogue: ", 10)) { int num; dialog = ff_ass_split_dialog(s->ass_ctx, ass, 0, &num); - // TODO reindent - for (; dialog && num--; dialog++) { - ff_ass_split_override_codes(&mov_text_callbacks, s, dialog->text); - } + for (; dialog && num--; dialog++) { + ff_ass_split_override_codes(&mov_text_callbacks, s, dialog->text); + } } else { #endif dialog = ff_ass_split_dialog2(s->ass_ctx, ass); diff --git a/libavcodec/srtenc.c b/libavcodec/srtenc.c index 9c8aefc66c..51439843b9 100644 --- a/libavcodec/srtenc.c +++ b/libavcodec/srtenc.c @@ -248,12 +248,11 @@ static int encode_frame(AVCodecContext *avctx, if (!strncmp(ass, "Dialogue: ", 10)) { int num; dialog = ff_ass_split_dialog(s->ass_ctx, ass, 0, &num); - // TODO reindent - for (; dialog && num--; dialog++) { - s->alignment_applied = 0; - srt_style_apply(s, dialog->style); - ff_ass_split_override_codes(cb, s, dialog->text); - } + for (; dialog && num--; dialog++) { + s->alignment_applied = 0; + srt_style_apply(s, dialog->style); + ff_ass_split_override_codes(cb, s, dialog->text); + } } else { #endif dialog = ff_ass_split_dialog2(s->ass_ctx, ass); diff --git a/libavformat/assenc.c b/libavformat/assenc.c index 54f4e97685..9a107aab7c 100644 --- a/libavformat/assenc.c +++ b/libavformat/assenc.c @@ -156,47 +156,46 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt) { ASSContext *ass = s->priv_data; - // TODO: reindent - long int layer; - char *p = pkt->data; - int64_t start = pkt->pts; - int64_t end = start + pkt->duration; - int hh1, mm1, ss1, ms1; - int hh2, mm2, ss2, ms2; - DialogueLine *dialogue = av_mallocz(sizeof(*dialogue)); - - if (!dialogue) - return AVERROR(ENOMEM); - - dialogue->readorder = strtol(p, &p, 10); - if (dialogue->readorder < ass->expected_readorder) - av_log(s, AV_LOG_WARNING, "Unexpected ReadOrder %d\n", - dialogue->readorder); - if (*p == ',') - p++; - - if (ass->ssa_mode && !strncmp(p, "Marked=", 7)) - p += 7; - - layer = strtol(p, &p, 10); - if (*p == ',') - p++; - hh1 = (int)(start / 360000); mm1 = (int)(start / 6000) % 60; - hh2 = (int)(end / 360000); mm2 = (int)(end / 6000) % 60; - ss1 = (int)(start / 100) % 60; ms1 = (int)(start % 100); - ss2 = (int)(end / 100) % 60; ms2 = (int)(end % 100); - if (hh1 > 9) hh1 = 9, mm1 = 59, ss1 = 59, ms1 = 99; - if (hh2 > 9) hh2 = 9, mm2 = 59, ss2 = 59, ms2 = 99; - - dialogue->line = av_asprintf("%s%ld,%d:%02d:%02d.%02d,%d:%02d:%02d.%02d,%s", - ass->ssa_mode ? "Marked=" : "", - layer, hh1, mm1, ss1, ms1, hh2, mm2, ss2, ms2, p); - if (!dialogue->line) { - av_free(dialogue); - return AVERROR(ENOMEM); - } - insert_dialogue(ass, dialogue); - purge_dialogues(s, ass->ignore_readorder); + long int layer; + char *p = pkt->data; + int64_t start = pkt->pts; + int64_t end = start + pkt->duration; + int hh1, mm1, ss1, ms1; + int hh2, mm2, ss2, ms2; + DialogueLine *dialogue = av_mallocz(sizeof(*dialogue)); + + if (!dialogue) + return AVERROR(ENOMEM); + + dialogue->readorder = strtol(p, &p, 10); + if (dialogue->readorder < ass->expected_readorder) + av_log(s, AV_LOG_WARNING, "Unexpected ReadOrder %d\n", + dialogue->readorder); + if (*p == ',') + p++; + + if (ass->ssa_mode && !strncmp(p, "Marked=", 7)) + p += 7; + + layer = strtol(p, &p, 10); + if (*p == ',') + p++; + hh1 = (int)(start / 360000); mm1 = (int)(start / 6000) % 60; + hh2 = (int)(end / 360000); mm2 = (int)(end / 6000) % 60; + ss1 = (int)(start / 100) % 60; ms1 = (int)(start % 100); + ss2 = (int)(end / 100) % 60; ms2 = (int)(end % 100); + if (hh1 > 9) hh1 = 9, mm1 = 59, ss1 = 59, ms1 = 99; + if (hh2 > 9) hh2 = 9, mm2 = 59, ss2 = 59, ms2 = 99; + + dialogue->line = av_asprintf("%s%ld,%d:%02d:%02d.%02d,%d:%02d:%02d.%02d,%s", + ass->ssa_mode ? "Marked=" : "", + layer, hh1, mm1, ss1, ms1, hh2, mm2, ss2, ms2, p); + if (!dialogue->line) { + av_free(dialogue); + return AVERROR(ENOMEM); + } + insert_dialogue(ass, dialogue); + purge_dialogues(s, ass->ignore_readorder); return 0; } |