]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/gsm_parser.c
h264: reset ref count if decoding the slice header fails
[ffmpeg] / libavcodec / gsm_parser.c
index 89afe80ef0ae8dc5cb3ae64d4e9c28a10ab214a2..c0befc779693fc671f72157f45f1ce9d1eab7e88 100644 (file)
@@ -45,12 +45,13 @@ static int gsm_parse(AVCodecParserContext *s1, AVCodecContext *avctx,
 
     if (!s->block_size) {
         switch (avctx->codec_id) {
-        case CODEC_ID_GSM:
+        case AV_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;
+        case AV_CODEC_ID_GSM_MS:
+            s->block_size = avctx->block_align ? avctx->block_align
+                                               : GSM_MS_BLOCK_SIZE;
             s->duration   = GSM_FRAME_SIZE * 2;
             break;
         default:
@@ -82,7 +83,7 @@ static int gsm_parse(AVCodecParserContext *s1, AVCodecContext *avctx,
 }
 
 AVCodecParser ff_gsm_parser = {
-    .codec_ids      = { CODEC_ID_GSM, CODEC_ID_GSM_MS },
+    .codec_ids      = { AV_CODEC_ID_GSM, AV_CODEC_ID_GSM_MS },
     .priv_data_size = sizeof(GSMParseContext),
     .parser_parse   = gsm_parse,
     .parser_close   = ff_parse_close,