Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Unified Diff: patched-ffmpeg-mt/libavformat/avc.c

Issue 789004: ffmpeg roll of source to mar 9 version... (Closed) Base URL: svn://chrome-svn/chrome/trunk/deps/third_party/ffmpeg/
Patch Set: '' Created 10 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: patched-ffmpeg-mt/libavformat/avc.c
===================================================================
--- patched-ffmpeg-mt/libavformat/avc.c (revision 41250)
+++ patched-ffmpeg-mt/libavformat/avc.c (working copy)
@@ -22,8 +22,9 @@
#include "libavutil/intreadwrite.h"
#include "avformat.h"
#include "avio.h"
+#include "avc.h"
-const uint8_t *ff_avc_find_startcode(const uint8_t *p, const uint8_t *end)
+static const uint8_t *ff_avc_find_startcode_internal(const uint8_t *p, const uint8_t *end)
{
const uint8_t *a = p + 4 - ((intptr_t)p & 3);
@@ -39,15 +40,15 @@
if ((x - 0x01010101) & (~x) & 0x80808080) { // generic
if (p[1] == 0) {
if (p[0] == 0 && p[2] == 1)
- return p-1;
+ return p;
if (p[2] == 0 && p[3] == 1)
- return p;
+ return p+1;
}
if (p[3] == 0) {
if (p[2] == 0 && p[4] == 1)
- return p+1;
+ return p+2;
if (p[4] == 0 && p[5] == 1)
- return p+2;
+ return p+3;
}
}
}
@@ -60,6 +61,12 @@
return end + 3;
}
+const uint8_t *ff_avc_find_startcode(const uint8_t *p, const uint8_t *end){
+ const uint8_t *out= ff_avc_find_startcode_internal(p, end);
+ if(p<out && out<end && !out[-1]) out--;
+ return out;
+}
+
int ff_avc_parse_nal_units(ByteIOContext *pb, const uint8_t *buf_in, int size)
{
const uint8_t *p = buf_in;

Powered by Google App Engine
This is Rietveld 408576698