diff options
author | Clément Bœsch <u@pkh.me> | 2016-02-27 00:15:20 +0300 |
---|---|---|
committer | Clément Bœsch <u@pkh.me> | 2016-02-27 00:15:20 +0300 |
commit | b5451d88cf8b0e165ae357f49254a66828351a56 (patch) | |
tree | b9f5d2927b17883a1114f2059cb0b64fb9587bb4 /libavformat/assenc.c | |
parent | 22ebbda637257a432c99330ca4c6024665418f0e (diff) |
lavc: reindent a few decoders after previous commits
Diffstat (limited to 'libavformat/assenc.c')
-rw-r--r-- | libavformat/assenc.c | 81 |
1 files changed, 40 insertions, 41 deletions
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; } |