Commit 2460b168 authored by Justin Ruggles's avatar Justin Ruggles

gsm parser: set duration

parent 7575ffac
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
typedef struct GSMParseContext { typedef struct GSMParseContext {
ParseContext pc; ParseContext pc;
int block_size; int block_size;
int duration;
int remaining; int remaining;
} GSMParseContext; } GSMParseContext;
...@@ -44,8 +45,14 @@ static int gsm_parse(AVCodecParserContext *s1, AVCodecContext *avctx, ...@@ -44,8 +45,14 @@ static int gsm_parse(AVCodecParserContext *s1, AVCodecContext *avctx,
if (!s->block_size) { if (!s->block_size) {
switch (avctx->codec_id) { switch (avctx->codec_id) {
case CODEC_ID_GSM: s->block_size = GSM_BLOCK_SIZE; break; case CODEC_ID_GSM:
case CODEC_ID_GSM_MS: s->block_size = GSM_MS_BLOCK_SIZE; break; 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: default:
return AVERROR(EINVAL); return AVERROR(EINVAL);
} }
...@@ -66,6 +73,9 @@ static int gsm_parse(AVCodecParserContext *s1, AVCodecContext *avctx, ...@@ -66,6 +73,9 @@ static int gsm_parse(AVCodecParserContext *s1, AVCodecContext *avctx,
*poutbuf_size = 0; *poutbuf_size = 0;
return buf_size; return buf_size;
} }
s1->duration = s->duration;
*poutbuf = buf; *poutbuf = buf;
*poutbuf_size = buf_size; *poutbuf_size = buf_size;
return next; return next;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment