diff mbox series

[FFmpeg-devel] avformat/rpl: cosmetics

Message ID 20210504120526.27373-1-zane@zanevaniperen.com
State Accepted
Commit 2329f7f21eb55281af439f70ded40a0c3ecec47b
Headers show
Series [FFmpeg-devel] avformat/rpl: cosmetics
Related show

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Zane van Iperen May 4, 2021, 12:05 p.m. UTC
Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
---
 libavformat/rpl.c | 26 ++++++++++----------------
 1 file changed, 10 insertions(+), 16 deletions(-)

Comments

Zane van Iperen May 5, 2021, 12:12 a.m. UTC | #1
On 4/5/21 10:05 pm, Zane van Iperen wrote:
> Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
> ---
>   libavformat/rpl.c | 26 ++++++++++----------------
>   1 file changed, 10 insertions(+), 16 deletions(-)
> 

I will apply this trivial change tomorrow, if no objections.
diff mbox series

Patch

diff --git a/libavformat/rpl.c b/libavformat/rpl.c
index f5d2b8fe59..367e80b2c4 100644
--- a/libavformat/rpl.c
+++ b/libavformat/rpl.c
@@ -216,18 +216,13 @@  static int rpl_read_header(AVFormatContext *s)
                 if (ast->codecpar->bits_per_coded_sample == 16) {
                     // 16-bit audio is always signed
                     ast->codecpar->codec_id = AV_CODEC_ID_PCM_S16LE;
-                    break;
                 } else if (ast->codecpar->bits_per_coded_sample == 8) {
-                    if(av_stristr(audio_type, "unsigned") != NULL) {
+                    if (av_stristr(audio_type, "unsigned") != NULL)
                         ast->codecpar->codec_id = AV_CODEC_ID_PCM_U8;
-                        break;
-                    } else if(av_stristr(audio_type, "linear") != NULL) {
+                    else if (av_stristr(audio_type, "linear") != NULL)
                         ast->codecpar->codec_id = AV_CODEC_ID_PCM_S8;
-                        break;
-                    } else {
+                    else
                         ast->codecpar->codec_id = AV_CODEC_ID_PCM_VIDC;
-                        break;
-                    }
                 }
                 // There are some other formats listed as legal per the spec;
                 // samples needed.
@@ -237,10 +232,8 @@  static int rpl_read_header(AVFormatContext *s)
                     // The samples with this kind of audio that I have
                     // are all unsigned.
                     ast->codecpar->codec_id = AV_CODEC_ID_PCM_U8;
-                    break;
                 } else if (ast->codecpar->bits_per_coded_sample == 4) {
                     ast->codecpar->codec_id = AV_CODEC_ID_ADPCM_IMA_EA_SEAD;
-                    break;
                 }
                 break;
         }
@@ -297,7 +290,8 @@  static int rpl_read_header(AVFormatContext *s)
         total_audio_size += audio_size * 8;
     }
 
-    if (error) return AVERROR(EIO);
+    if (error)
+        return AVERROR(EIO);
 
     return 0;
 }
@@ -322,9 +316,10 @@  static int rpl_read_packet(AVFormatContext *s, AVPacket *pkt)
 
     index_entry = &stream->internal->index_entries[rpl->chunk_number];
 
-    if (rpl->frame_in_part == 0)
+    if (rpl->frame_in_part == 0) {
         if (avio_seek(pb, index_entry->pos, SEEK_SET) < 0)
             return AVERROR(EIO);
+    }
 
     if (stream->codecpar->codec_type == AVMEDIA_TYPE_VIDEO &&
         stream->codecpar->codec_tag == 124) {
@@ -340,9 +335,9 @@  static int rpl_read_packet(AVFormatContext *s, AVPacket *pkt)
         ret = av_get_packet(pb, pkt, frame_size);
         if (ret < 0)
             return ret;
-        if (ret != frame_size) {
+        if (ret != frame_size)
             return AVERROR(EIO);
-        }
+
         pkt->duration = 1;
         pkt->pts = index_entry->timestamp + rpl->frame_in_part;
         pkt->stream_index = rpl->chunk_part;
@@ -356,9 +351,8 @@  static int rpl_read_packet(AVFormatContext *s, AVPacket *pkt)
         ret = av_get_packet(pb, pkt, index_entry->size);
         if (ret < 0)
             return ret;
-        if (ret != index_entry->size) {
+        if (ret != index_entry->size)
             return AVERROR(EIO);
-        }
 
         if (stream->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) {
             // frames_per_chunk should always be one here; the header