mirror of
https://gitee.com/openharmony/third_party_ffmpeg
synced 2024-11-23 11:19:55 +00:00
gsm parser: set duration
This commit is contained in:
parent
7575ffac8a
commit
2460b168b4
@ -31,6 +31,7 @@
|
||||
typedef struct GSMParseContext {
|
||||
ParseContext pc;
|
||||
int block_size;
|
||||
int duration;
|
||||
int remaining;
|
||||
} GSMParseContext;
|
||||
|
||||
@ -44,8 +45,14 @@ static int gsm_parse(AVCodecParserContext *s1, AVCodecContext *avctx,
|
||||
|
||||
if (!s->block_size) {
|
||||
switch (avctx->codec_id) {
|
||||
case CODEC_ID_GSM: s->block_size = GSM_BLOCK_SIZE; break;
|
||||
case CODEC_ID_GSM_MS: s->block_size = GSM_MS_BLOCK_SIZE; break;
|
||||
case CODEC_ID_GSM:
|
||||
s->block_size = GSM_BLOCK_SIZE;
|
||||
s->duration = GSM_FRAME_SIZE;
|
||||
break;
|
||||
case CODEC_ID_GSM_MS:
|
||||
s->block_size = GSM_MS_BLOCK_SIZE;
|
||||
s->duration = GSM_FRAME_SIZE * 2;
|
||||
break;
|
||||
default:
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
@ -66,6 +73,9 @@ static int gsm_parse(AVCodecParserContext *s1, AVCodecContext *avctx,
|
||||
*poutbuf_size = 0;
|
||||
return buf_size;
|
||||
}
|
||||
|
||||
s1->duration = s->duration;
|
||||
|
||||
*poutbuf = buf;
|
||||
*poutbuf_size = buf_size;
|
||||
return next;
|
||||
|
Loading…
Reference in New Issue
Block a user