g722: Return 8 bits per sample for g722 in av_get_bits_per_sample

Message ID 1302455710-15183-1-git-send-email-martin@martin.st
State Committed
Headers show

Commit Message

Martin Storsjö April 10, 2011, 5:15 p.m.
This fixes a failing assert in ff_raw_read_header (in
fate-g722dec-1), where bits_per_coded_sample is set using this
function and is required to have a positive value.
---
 libavcodec/utils.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

Comments

Kostya Shishkov April 10, 2011, 5:36 p.m. | #1
On Sun, Apr 10, 2011 at 08:15:10PM +0300, Martin Storsjö wrote:
> This fixes a failing assert in ff_raw_read_header (in
> fate-g722dec-1), where bits_per_coded_sample is set using this
> function and is required to have a positive value.

looks like case values there are sorted by bits value, so adding it at the end
should be only for bits > 64

Patch

diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 12561d0..8f99260 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -1135,6 +1135,8 @@  int av_get_bits_per_sample(enum CodecID codec_id){
     case CODEC_ID_PCM_F64BE:
     case CODEC_ID_PCM_F64LE:
         return 64;
+    case CODEC_ID_ADPCM_G722:
+        return 8;
     default:
         return 0;
     }