History

avformat/hlsenc: make fix code style of hls_write_trailer

change vs->avf to oc

Steven Liu committed 7 years ago

Commit 8efc9fc1 parent 2e82b501 file · +8 −8Browse files

Unified · Split

libavformat/hlsenc.c+8−8
@@ -2537,7 +2537,7 @@ static int hls_write_trailer(struct AVFormatContext *s) · 2536 unmodified lines
2537 vs = &hls->var_streams[i];2537 vs = &hls->var_streams[i];
2538 oc = vs->avf;2538 oc = vs->avf;
2539 vtt_oc = vs->vtt_avf;2539 vtt_oc = vs->vtt_avf;
2540 old_filename = av_strdup(vs->avf->url);2540 old_filename = av_strdup(oc->url);
2541 use_temp_file = 0;2541 use_temp_file = 0;
2542 2542
2543 if (!old_filename) {2543 if (!old_filename) {
@@ -2546,9 +2546,9 @@ static int hls_write_trailer(struct AVFormatContext *s) · 2 unmodified lines
2546 if (hls->key_info_file || hls->encrypt) {2546 if (hls->key_info_file || hls->encrypt) {
2547 av_dict_set(&options, "encryption_key", hls->key_string, 0);2547 av_dict_set(&options, "encryption_key", hls->key_string, 0);
2548 av_dict_set(&options, "encryption_iv", hls->iv_string, 0);2548 av_dict_set(&options, "encryption_iv", hls->iv_string, 0);
2549 filename = av_asprintf("crypto:%s", vs->avf->url);2549 filename = av_asprintf("crypto:%s", oc->url);
2550 } else {2550 } else {
2551 filename = av_asprintf("%s", vs->avf->url);2551 filename = av_asprintf("%s", oc->url);
2552 }2552 }
2553 if (!filename) {2553 if (!filename) {
2554 av_free(old_filename);2554 av_free(old_filename);
@@ -2559,7 +2559,7 @@ static int hls_write_trailer(struct AVFormatContext *s) · 4 unmodified lines
2559 int range_length = 0;2559 int range_length = 0;
2560 if (!vs->init_range_length) {2560 if (!vs->init_range_length) {
2561 uint8_t *buffer = NULL;2561 uint8_t *buffer = NULL;
2562 av_write_frame(vs->avf, NULL); /* Flush any buffered data */2562 av_write_frame(oc, NULL); /* Flush any buffered data */
2563 avio_flush(oc->pb);2563 avio_flush(oc->pb);
2564 2564
2565 range_length = avio_close_dyn_buf(oc->pb, &buffer);2565 range_length = avio_close_dyn_buf(oc->pb, &buffer);
@@ -2580,7 +2580,7 @@ static int hls_write_trailer(struct AVFormatContext *s) · 14 unmodified lines
2580 set_http_options(s, &options, hls);2580 set_http_options(s, &options, hls);
2581 ret = hlsenc_io_open(s, &vs->out, filename, &options);2581 ret = hlsenc_io_open(s, &vs->out, filename, &options);
2582 if (ret < 0) {2582 if (ret < 0) {
2583 av_log(s, AV_LOG_ERROR, "Failed to open file '%s'\n", vs->avf->url);2583 av_log(s, AV_LOG_ERROR, "Failed to open file '%s'\n", oc->url);
2584 goto failed;2584 goto failed;
2585 }2585 }
2586 if (hls->segment_type == SEGMENT_TYPE_FMP4)2586 if (hls->segment_type == SEGMENT_TYPE_FMP4)
@@ -2598,13 +2598,13 @@ static int hls_write_trailer(struct AVFormatContext *s) · 11 unmodified lines
2598 ff_format_io_close(s, &vs->out);2598 ff_format_io_close(s, &vs->out);
2599 ret = hlsenc_io_open(s, &vs->out, filename, &options);2599 ret = hlsenc_io_open(s, &vs->out, filename, &options);
2600 if (ret < 0) {2600 if (ret < 0) {
2601 av_log(s, AV_LOG_ERROR, "Failed to open file '%s'\n", vs->avf->url);2601 av_log(s, AV_LOG_ERROR, "Failed to open file '%s'\n", oc->url);
2602 goto failed;2602 goto failed;
2603 }2603 }
2604 reflush_dynbuf(vs, &range_length);2604 reflush_dynbuf(vs, &range_length);
2605 ret = hlsenc_io_close(s, &vs->out, filename);2605 ret = hlsenc_io_close(s, &vs->out, filename);
2606 if (ret < 0)2606 if (ret < 0)
2607 av_log(s, AV_LOG_WARNING, "Failed to upload file '%s' at the end.\n", vs->avf->url);2607 av_log(s, AV_LOG_WARNING, "Failed to upload file '%s' at the end.\n", oc->url);
2608 }2608 }
2609 av_free(vs->temp_buffer);2609 av_free(vs->temp_buffer);
2610 2610
@@ -2620,7 +2620,7 @@ failed: · 9 unmodified lines
2620 if (use_temp_file && !(hls->flags & HLS_SINGLE_FILE)) {2620 if (use_temp_file && !(hls->flags & HLS_SINGLE_FILE)) {
2621 hls_rename_temp_file(s, oc);2621 hls_rename_temp_file(s, oc);
2622 av_free(old_filename);2622 av_free(old_filename);
2623 old_filename = av_strdup(vs->avf->url);2623 old_filename = av_strdup(oc->url);
2624 2624
2625 if (!old_filename) {2625 if (!old_filename) {
2626 return AVERROR(ENOMEM);2626 return AVERROR(ENOMEM);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t