mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-05-24 13:42:56 +02:00
libstagefright: set the correct frame size
This commit is contained in:
parent
e7f9aa6ff5
commit
09a49e8919
@ -311,7 +311,7 @@ static int Stagefright_decode_frame(AVCodecContext *avctx, void *data,
|
|||||||
frame = (Frame*)av_mallocz(sizeof(Frame));
|
frame = (Frame*)av_mallocz(sizeof(Frame));
|
||||||
if (avpkt->data) {
|
if (avpkt->data) {
|
||||||
frame->status = OK;
|
frame->status = OK;
|
||||||
frame->size = orig_size;
|
frame->size = avpkt->size;
|
||||||
// Stagefright can't handle negative timestamps -
|
// Stagefright can't handle negative timestamps -
|
||||||
// if needed, work around this by offsetting them manually?
|
// if needed, work around this by offsetting them manually?
|
||||||
if (avpkt->pts >= 0)
|
if (avpkt->pts >= 0)
|
||||||
@ -324,8 +324,10 @@ static int Stagefright_decode_frame(AVCodecContext *avctx, void *data,
|
|||||||
}
|
}
|
||||||
uint8_t *ptr = avpkt->data;
|
uint8_t *ptr = avpkt->data;
|
||||||
// The OMX.SEC decoder fails without this.
|
// 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;
|
ptr += avctx->extradata_size;
|
||||||
|
frame->size = orig_size;
|
||||||
|
}
|
||||||
memcpy(frame->buffer, ptr, orig_size);
|
memcpy(frame->buffer, ptr, orig_size);
|
||||||
} else {
|
} else {
|
||||||
frame->status = ERROR_END_OF_STREAM;
|
frame->status = ERROR_END_OF_STREAM;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user