diff mbox series

[FFmpeg-devel,4/4] avformat/hlsenc, hlsplaylist: Cosmetics

Message ID 20200525194302.24515-4-andreas.rheinhardt@gmail.com
State Accepted
Commit 6c70f89813a67238288705d07c928b4eac7a8cae
Headers show
Series [FFmpeg-devel,1/4] avformat/hlsplaylist: Add const where appropriate | expand

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Andreas Rheinhardt May 25, 2020, 7:43 p.m. UTC
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
---
 libavformat/hlsenc.c      |  5 ++---
 libavformat/hlsplaylist.c | 22 ++++++++++++++--------
 libavformat/hlsplaylist.h |  9 +++++----
 3 files changed, 21 insertions(+), 15 deletions(-)
diff mbox series

Patch

diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index 02bd5c3528..18256cbf91 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -2137,9 +2137,8 @@  static int update_variant_stream_info(AVFormatContext *s)
             return AVERROR(ENOMEM);
 
         //by default, the first available ccgroup is mapped to the variant stream
-        if (hls->nb_ccstreams) {
+        if (hls->nb_ccstreams)
             hls->var_streams[0].ccgroup = hls->cc_streams[0].ccgroup;
-        }
 
         for (i = 0; i < s->nb_streams; i++)
             hls->var_streams[0].streams[i] = s->streams[i];
@@ -2320,7 +2319,7 @@  static int hls_write_packet(AVFormatContext *s, AVPacket *pkt)
         vs->start_pts_from_audio = 0;
     }
 
-   if (vs->has_video) {
+    if (vs->has_video) {
         can_split = st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO &&
                     ((pkt->flags & AV_PKT_FLAG_KEY) || (hls->flags & HLS_SPLIT_BY_TIME));
         is_ref_pkt = (st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) && (pkt->stream_index == vs->reference_stream_index);
diff --git a/libavformat/hlsplaylist.c b/libavformat/hlsplaylist.c
index 7a89846369..0e1dcc087f 100644
--- a/libavformat/hlsplaylist.c
+++ b/libavformat/hlsplaylist.c
@@ -28,7 +28,8 @@ 
 #include "avformat.h"
 #include "hlsplaylist.h"
 
-void ff_hls_write_playlist_version(AVIOContext *out, int version) {
+void ff_hls_write_playlist_version(AVIOContext *out, int version)
+{
     if (!out)
         return;
     avio_printf(out, "#EXTM3U\n");
@@ -96,7 +97,8 @@  void ff_hls_write_stream_info(AVStream *st, AVIOContext *out, int bandwidth,
 
 void ff_hls_write_playlist_header(AVIOContext *out, int version, int allowcache,
                                   int target_duration, int64_t sequence,
-                                  uint32_t playlist_type, int iframe_mode) {
+                                  uint32_t playlist_type, int iframe_mode)
+{
     if (!out)
         return;
     ff_hls_write_playlist_version(out, version);
@@ -118,7 +120,8 @@  void ff_hls_write_playlist_header(AVIOContext *out, int version, int allowcache,
 }
 
 void ff_hls_write_init_file(AVIOContext *out, const char *filename,
-                            int byterange_mode, int64_t size, int64_t pos) {
+                            int byterange_mode, int64_t size, int64_t pos)
+{
     avio_printf(out, "#EXT-X-MAP:URI=\"%s\"", filename);
     if (byterange_mode) {
         avio_printf(out, ",BYTERANGE=\"%"PRId64"@%"PRId64"\"", size, pos);
@@ -127,12 +130,14 @@  void ff_hls_write_init_file(AVIOContext *out, const char *filename,
 }
 
 int ff_hls_write_file_entry(AVIOContext *out, int insert_discont,
-                             int byterange_mode,
-                             double duration, int round_duration,
-                             int64_t size, int64_t pos, //Used only if HLS_SINGLE_FILE flag is set
+                            int byterange_mode, double duration,
+                            int round_duration, int64_t size,
+                            int64_t pos /* Used only if HLS_SINGLE_FILE flag is set */,
                             const char *baseurl /* Ignored if NULL */,
                             const char *filename, double *prog_date_time,
-                             int64_t video_keyframe_size, int64_t video_keyframe_pos, int iframe_mode) {
+                            int64_t video_keyframe_size, int64_t video_keyframe_pos,
+                            int iframe_mode)
+{
     if (!out || !filename)
         return AVERROR(EINVAL);
 
@@ -181,7 +186,8 @@  int ff_hls_write_file_entry(AVIOContext *out, int insert_discont,
     return 0;
 }
 
-void ff_hls_write_end_list (AVIOContext *out) {
+void ff_hls_write_end_list(AVIOContext *out)
+{
     if (!out)
         return;
     avio_printf(out, "#EXT-X-ENDLIST\n");
diff --git a/libavformat/hlsplaylist.h b/libavformat/hlsplaylist.h
index 4348a26c75..29487da3ed 100644
--- a/libavformat/hlsplaylist.h
+++ b/libavformat/hlsplaylist.h
@@ -53,12 +53,13 @@  void ff_hls_write_playlist_header(AVIOContext *out, int version, int allowcache,
 void ff_hls_write_init_file(AVIOContext *out, const char *filename,
                             int byterange_mode, int64_t size, int64_t pos);
 int ff_hls_write_file_entry(AVIOContext *out, int insert_discont,
-                             int byterange_mode,
-                             double duration, int round_duration,
-                             int64_t size, int64_t pos, //Used only if HLS_SINGLE_FILE flag is set
+                            int byterange_mode, double duration,
+                            int round_duration, int64_t size,
+                            int64_t pos /* Used only if HLS_SINGLE_FILE flag is set */,
                             const char *baseurl /* Ignored if NULL */,
                             const char *filename, double *prog_date_time,
-                             int64_t video_keyframe_size, int64_t video_keyframe_pos, int iframe_mode);
+                            int64_t video_keyframe_size, int64_t video_keyframe_pos,
+                            int iframe_mode);
 void ff_hls_write_end_list (AVIOContext *out);
 
 #endif /* AVFORMAT_HLSPLAYLIST_H_ */