<div dir="ltr">Thanks for your review, a new patch is attached.<br><br>From b52f501f7c9ad4521cf571d2b1b6531a6f1fa6cc Mon Sep 17 00:00:00 2001<br>From: Zhao Zhili <<a href="mailto:wantlamy@gmail.com">wantlamy@gmail.com</a>><br>Date: Tue, 14 Jun 2016 00:51:52 +0800<br>Subject: [PATCH] fourcc: refactor Lookup<br><br>---<br> src/misc/fourcc.c | 15 ++++-----------<br> 1 file changed, 4 insertions(+), 11 deletions(-)<br><br>diff --git a/src/misc/fourcc.c b/src/misc/fourcc.c<br>index 51c36a1..f1341d7 100644<br>--- a/src/misc/fourcc.c<br>+++ b/src/misc/fourcc.c<br>@@ -45,24 +45,17 @@ static vlc_fourcc_t Lookup(vlc_fourcc_t fourcc, const char **restrict dsc,<br> const struct fourcc_desc *dscv, size_t dscc)<br> {<br> const struct fourcc_mapping *mapping;<br>- const struct fourcc_desc *desc;<br>+ const struct fourcc_desc *desc = NULL;<br> <br> mapping = bsearch(&fourcc, mapv, mapc, sizeof (*mapv), fourcc_cmp);<br> if (mapping != NULL)<br> {<br>- if (dsc != NULL)<br>- {<br>- desc = bsearch(&fourcc, dscv, dscc, sizeof (*dscv), fourcc_cmp);<br>- if (desc != NULL)<br>- {<br>- *dsc = desc->desc;<br>- return mapping->fourcc;<br>- }<br>- }<br>+ desc = bsearch(&fourcc, dscv, dscc, sizeof (*dscv), fourcc_cmp);<br> fourcc = mapping->fourcc;<br> }<br> <br>- desc = bsearch(&fourcc, dscv, dscc, sizeof (*dscv), fourcc_cmp);<br>+ if (desc == NULL)<br>+ desc = bsearch(&fourcc, dscv, dscc, sizeof (*dscv), fourcc_cmp);<br> if (desc == NULL)<br> return 0; /* Unknown FourCC */<br> if (dsc != NULL)<br>-- <br>2.7.4<br><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jun 13, 2016 at 8:18 PM, Rémi Denis-Courmont <span dir="ltr"><<a href="mailto:remi@remlab.net" target="_blank">remi@remlab.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">Le 2016-06-13 12:12, Zhao Zhili a écrit :<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
---<br>
src/misc/fourcc.c | 11 -----------<br>
1 file changed, 11 deletions(-)<br>
<br>
diff --git a/src/misc/fourcc.c b/src/misc/fourcc.c<br>
index 51c36a1..d69c49b 100644<br>
--- a/src/misc/fourcc.c<br>
+++ b/src/misc/fourcc.c<br>
@@ -49,18 +49,7 @@ static vlc_fourcc_t Lookup(vlc_fourcc_t fourcc,<br>
const char **restrict dsc,<br>
<br>
mapping = bsearch(&fourcc, mapv, mapc, sizeof (*mapv),<br>
fourcc_cmp);<br>
if (mapping != NULL)<br>
- {<br>
- if (dsc != NULL)<br>
- {<br>
- desc = bsearch(&fourcc, dscv, dscc, sizeof<br>
(*dscv), fourcc_cmp);<br>
- if (desc != NULL)<br>
- {<br>
- *dsc = desc->desc;<br>
- return mapping->fourcc;<br>
- }<br>
- }<br>
fourcc = mapping->fourcc;<br>
- }<br>
<br>
desc = bsearch(&fourcc, dscv, dscc, sizeof (*dscv),<br>
fourcc_cmp);<br>
if (desc == NULL)<br>
</blockquote>
<br></div></div>
Doesn't this break E() fourCC entries?<span class="HOEnZb"><font color="#888888"><br>
<br>
-- <br>
Rémi Denis-Courmont<br>
<a href="http://www.remlab.net/" rel="noreferrer" target="_blank">http://www.remlab.net/</a><br>
_______________________________________________<br>
vlc-devel mailing list<br>
To unsubscribe or modify your subscription options:<br>
<a href="https://mailman.videolan.org/listinfo/vlc-devel" rel="noreferrer" target="_blank">https://mailman.videolan.org/listinfo/vlc-devel</a><br>
</font></span></blockquote></div><br></div></div>