mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-25 00:32:31 +00:00
avutil/stereo3d: Use av_strstart instead of strncmp
It makes the intent clearer and avoids calculating the length separately. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
This commit is contained in:
parent
114603d0b9
commit
13e98f1daf
@ -18,9 +18,9 @@
|
|||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdint.h>
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
#include "avstring.h"
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "mem.h"
|
#include "mem.h"
|
||||||
#include "stereo3d.h"
|
#include "stereo3d.h"
|
||||||
@ -67,8 +67,7 @@ int av_stereo3d_from_name(const char *name)
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < FF_ARRAY_ELEMS(stereo3d_type_names); i++) {
|
for (i = 0; i < FF_ARRAY_ELEMS(stereo3d_type_names); i++) {
|
||||||
size_t len = strlen(stereo3d_type_names[i]);
|
if (av_strstart(name, stereo3d_type_names[i], NULL))
|
||||||
if (!strncmp(stereo3d_type_names[i], name, len))
|
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user