mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
CrystalHD: Fix usage of h264 parser.
I was using the wrong value to track the position of the parser in the stream. For an error-free stream, the size of the frame and number of bytes consumed will be the same, but in an error situation they can diverge. Signed-off-by: Philip Langdale <philipl@overt.org>
This commit is contained in:
parent
09a1416db7
commit
bd9430db69
@ -796,13 +796,19 @@ static int decode(AVCodecContext *avctx, void *data, int *data_size, AVPacket *a
|
||||
|
||||
if (priv->parser) {
|
||||
uint8_t *pout;
|
||||
int psize = len;
|
||||
int psize;
|
||||
const uint8_t *in_data = avpkt->data;
|
||||
int in_len = len;
|
||||
H264Context *h = priv->parser->priv_data;
|
||||
|
||||
while (psize)
|
||||
ret = av_parser_parse2(priv->parser, avctx, &pout, &psize,
|
||||
avpkt->data, len, avctx->pkt->pts,
|
||||
avctx->pkt->dts, len - psize);
|
||||
while (in_len) {
|
||||
int index;
|
||||
index = av_parser_parse2(priv->parser, avctx, &pout, &psize,
|
||||
in_data, in_len, avctx->pkt->pts,
|
||||
avctx->pkt->dts, 0);
|
||||
in_data += index;
|
||||
in_len -= index;
|
||||
}
|
||||
av_log(avctx, AV_LOG_VERBOSE,
|
||||
"CrystalHD: parser picture type %d\n",
|
||||
h->s.picture_structure);
|
||||
|
Loading…
Reference in New Issue
Block a user