mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
avcodec/vc1: simplify find_next_marker()
Signed-off-by: Zeng Zhaoxiu <zhaoxiu.zeng@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
3e2714992b
commit
b39ac9d210
@ -26,6 +26,7 @@
|
||||
#include <stdint.h>
|
||||
|
||||
#include "libavutil/attributes.h"
|
||||
#include "internal.h"
|
||||
|
||||
/** Markers used in VC-1 AP frame data */
|
||||
//@{
|
||||
@ -57,12 +58,9 @@ enum Profile {
|
||||
*/
|
||||
static av_always_inline const uint8_t* find_next_marker(const uint8_t *src, const uint8_t *end)
|
||||
{
|
||||
if (end - src >= 4) {
|
||||
uint32_t mrk = 0xFFFFFFFF;
|
||||
|
||||
if (end-src < 4)
|
||||
return end;
|
||||
while (src < end) {
|
||||
mrk = (mrk << 8) | *src++;
|
||||
src = avpriv_find_start_code(src, end, &mrk);
|
||||
if (IS_MARKER(mrk))
|
||||
return src - 4;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user