diff mbox series

[FFmpeg-devel,2/3] avformat/dashdec: fix code style in is_common_init_section_exist

Message ID 20210112132004.23534-2-liuqi05@kuaishou.com
State New
Headers show
Series [FFmpeg-devel,1/3] avformat/dashdec: check init_section before use it.
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

liuqi05 Jan. 12, 2021, 1:20 p.m. UTC
make the code block short when it too long.

Signed-off-by: liuqi05 <liuqi05@kuaishou.com>
---
 libavformat/dashdec.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Moritz Barsnick Jan. 15, 2021, 12:02 p.m. UTC | #1
On Tue, Jan 12, 2021 at 21:20:03 +0800, liuqi05 wrote:
> -        if (av_strcasecmp(pls[i]->init_section->url, url) || pls[i]->init_section->url_offset != url_offset || pls[i]->init_section->size != size) {
> +        if (av_strcasecmp(pls[i]->init_section->url, url) ||
> +                          pls[i]->init_section->url_offset != url_offset ||
> +                          pls[i]->init_section->size != size) {

Good idea, but the indentation is incorrect. The subsequent lines are
not arguments to av_strcasecmp(), but further clauses for if().

Also, you should make this change the first commit of your series which
would make what is now your first commit, including another cosmetic
change (added space), much more compact and easier to read.

Cheers,
Moritz
Steven Liu Jan. 15, 2021, 12:13 p.m. UTC | #2
> 2021年1月15日 下午8:02,Moritz Barsnick <barsnick@gmx.net> 写道:
> 
> On Tue, Jan 12, 2021 at 21:20:03 +0800, liuqi05 wrote:
>> -        if (av_strcasecmp(pls[i]->init_section->url, url) || pls[i]->init_section->url_offset != url_offset || pls[i]->init_section->size != size) {
>> +        if (av_strcasecmp(pls[i]->init_section->url, url) ||
>> +                          pls[i]->init_section->url_offset != url_offset ||
>> +                          pls[i]->init_section->size != size) {
> 
> Good idea, but the indentation is incorrect. The subsequent lines are
> not arguments to av_strcasecmp(), but further clauses for if().
> 
> Also, you should make this change the first commit of your series which
Hi Moritz,

	Do you mean this modify should be merged into the first patch?

> would make what is now your first commit, including another cosmetic
> change (added space), much more compact and easier to read.
> 
> Cheers,
> Moritz
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

Thanks

Steven Liu
Moritz Barsnick Jan. 27, 2021, 10:58 a.m. UTC | #3
On Fri, Jan 15, 2021 at 20:13:44 +0800, Steven Liu wrote:
> > Good idea, but the indentation is incorrect. The subsequent lines are
> > not arguments to av_strcasecmp(), but further clauses for if().
> >
> > Also, you should make this change the first commit of your series which
> Hi Moritz,
>
> 	Do you mean this modify should be merged into the first patch?

The style changes should be merged into one patch. (The first patch
included a style change.)

Moritz
diff mbox series

Patch

diff --git a/libavformat/dashdec.c b/libavformat/dashdec.c
index 5f9b9ba882..85b5f147e8 100644
--- a/libavformat/dashdec.c
+++ b/libavformat/dashdec.c
@@ -1995,7 +1995,9 @@  static int is_common_init_section_exist(struct representation **pls, int n_pls)
         if (!pls[i]->init_section)
             continue;
 
-        if (av_strcasecmp(pls[i]->init_section->url, url) || pls[i]->init_section->url_offset != url_offset || pls[i]->init_section->size != size) {
+        if (av_strcasecmp(pls[i]->init_section->url, url) ||
+                          pls[i]->init_section->url_offset != url_offset ||
+                          pls[i]->init_section->size != size) {
             return 0;
         }
     }