[FFmpeg-cvslog] Silence warnings when decoding QNAP Systems H264 codec.
Carl Eugen Hoyos
git at videolan.org
Sat Dec 3 03:34:53 CET 2011
ffmpeg | branch: master | Carl Eugen Hoyos <cehoyos at ag.or.at> | Sat Dec 3 03:31:24 2011 +0100| [2d6a45c12a9151aa8c3407cd2981a160c71db708] | committer: Carl Eugen Hoyos
Silence warnings when decoding QNAP Systems H264 codec.
Fixes ticket #571.
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2d6a45c12a9151aa8c3407cd2981a160c71db708
---
libavcodec/h264.c | 3 ++-
libavcodec/h264_parser.c | 3 +++
2 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 3bc13aa..2974d81 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -4083,7 +4083,8 @@ static int decode_frame(AVCodecContext *avctx,
}
if(!(s->flags2 & CODEC_FLAG2_CHUNKS) && !s->current_picture_ptr){
- if (avctx->skip_frame >= AVDISCARD_NONREF)
+ if (avctx->skip_frame >= AVDISCARD_NONREF ||
+ buf_size >= 4 && !memcmp("Q264", buf, 4))
return 0;
av_log(avctx, AV_LOG_ERROR, "no frame!\n");
return -1;
diff --git a/libavcodec/h264_parser.c b/libavcodec/h264_parser.c
index 0b8798d..ee766a1 100644
--- a/libavcodec/h264_parser.c
+++ b/libavcodec/h264_parser.c
@@ -148,6 +148,7 @@ static inline int parse_nal_units(AVCodecParserContext *s,
unsigned int slice_type;
int state = -1;
const uint8_t *ptr;
+ int q264 = buf_size >=4 && !memcmp("Q264", buf, 4);
/* set some sane default values */
s->pict_type = AV_PICTURE_TYPE_I;
@@ -266,6 +267,8 @@ static inline int parse_nal_units(AVCodecParserContext *s,
}
buf += consumed;
}
+ if (q264)
+ return 0;
/* didn't find a picture! */
av_log(h->s.avctx, AV_LOG_ERROR, "missing picture in access unit with size %d\n", buf_size);
return -1;
More information about the ffmpeg-cvslog
mailing list