diff options
author | Mohamed Naufal <naufal22@gmail.com> | 2011-10-07 17:01:08 +0530 |
---|---|---|
committer | Mohamed Naufal <naufal22@gmail.com> | 2011-10-07 18:32:23 +0530 |
commit | 09a49e8919ddd31d0255f46ad1c3d19be7bb5ed1 (patch) | |
tree | 0157b58f054a7efd2d281630ddb45956e0874b73 /libavcodec | |
parent | e7f9aa6ff5c850df173784d88ef8c79b22513d96 (diff) | |
download | ffmpeg-09a49e8919ddd31d0255f46ad1c3d19be7bb5ed1.tar.gz |
libstagefright: set the correct frame size
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/libstagefright.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libavcodec/libstagefright.cpp b/libavcodec/libstagefright.cpp index 2022bab37e..6989357f53 100644 --- a/libavcodec/libstagefright.cpp +++ b/libavcodec/libstagefright.cpp @@ -311,7 +311,7 @@ static int Stagefright_decode_frame(AVCodecContext *avctx, void *data, frame = (Frame*)av_mallocz(sizeof(Frame)); if (avpkt->data) { frame->status = OK; - frame->size = orig_size; + frame->size = avpkt->size; // Stagefright can't handle negative timestamps - // if needed, work around this by offsetting them manually? if (avpkt->pts >= 0) @@ -324,8 +324,10 @@ static int Stagefright_decode_frame(AVCodecContext *avctx, void *data, } uint8_t *ptr = avpkt->data; // The OMX.SEC decoder fails without this. - if (avpkt->size == orig_size + avctx->extradata_size) + if (avpkt->size == orig_size + avctx->extradata_size) { ptr += avctx->extradata_size; + frame->size = orig_size; + } memcpy(frame->buffer, ptr, orig_size); } else { frame->status = ERROR_END_OF_STREAM; |