[FFmpeg-cvslog] lavc/h264_parser: pass logctx to h264_find_frame_end()

Clément Bœsch git at videolan.org
Sun Jun 19 12:41:33 CEST 2016


ffmpeg | branch: master | Clément Bœsch <u at pkh.me> | Sun Jun 19 12:34:38 2016 +0200| [48ea5433c813835907f053d38673f7112cd9c4a6] | committer: Clément Bœsch

lavc/h264_parser: pass logctx to h264_find_frame_end()

This helps removing the H264Context from the H264ParseContext.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=48ea5433c813835907f053d38673f7112cd9c4a6
---

 libavcodec/h264_parser.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/libavcodec/h264_parser.c b/libavcodec/h264_parser.c
index bb167b7..be7e7ab 100644
--- a/libavcodec/h264_parser.c
+++ b/libavcodec/h264_parser.c
@@ -59,7 +59,7 @@ typedef struct H264ParseContext {
 
 
 static int h264_find_frame_end(H264ParseContext *p, const uint8_t *buf,
-                               int buf_size)
+                               int buf_size, void *logctx)
 {
     H264Context *h = &p->h;
     int i, j;
@@ -73,7 +73,7 @@ static int h264_find_frame_end(H264ParseContext *p, const uint8_t *buf,
         state = 7;
 
     if (p->is_avc && !p->nal_length_size)
-        av_log(h->avctx, AV_LOG_ERROR, "AVC-parser: nal length size invalid\n");
+        av_log(logctx, AV_LOG_ERROR, "AVC-parser: nal length size invalid\n");
 
     for (i = 0; i < buf_size; i++) {
         if (i >= next_avc) {
@@ -82,7 +82,7 @@ static int h264_find_frame_end(H264ParseContext *p, const uint8_t *buf,
             for (j = 0; j < p->nal_length_size; j++)
                 nalsize = (nalsize << 8) | buf[i++];
             if (nalsize <= 0 || nalsize > buf_size - i) {
-                av_log(h->avctx, AV_LOG_ERROR, "AVC-parser: nal size %d remaining %d\n", nalsize, buf_size - i);
+                av_log(logctx, AV_LOG_ERROR, "AVC-parser: nal size %d remaining %d\n", nalsize, buf_size - i);
                 return buf_size;
             }
             next_avc = i + nalsize;
@@ -585,7 +585,7 @@ static int h264_parse(AVCodecParserContext *s,
     if (s->flags & PARSER_FLAG_COMPLETE_FRAMES) {
         next = buf_size;
     } else {
-        next = h264_find_frame_end(p, buf, buf_size);
+        next = h264_find_frame_end(p, buf, buf_size, avctx);
 
         if (ff_combine_frame(pc, next, &buf, &buf_size) < 0) {
             *poutbuf      = NULL;
@@ -595,7 +595,7 @@ static int h264_parse(AVCodecParserContext *s,
 
         if (next < 0 && next != END_NOT_FOUND) {
             av_assert1(pc->last_index + next >= 0);
-            h264_find_frame_end(p, &pc->buffer[pc->last_index + next], -next); // update state
+            h264_find_frame_end(p, &pc->buffer[pc->last_index + next], -next, avctx); // update state
         }
     }
 



More information about the ffmpeg-cvslog mailing list