g722: Return 8 bits per sample for g722 in av_get_bits_per_sample

Message ID 1302457183-15309-1-git-send-email-martin@martin.st
State Committed
Commit 029f966c3aa73531a90cb14ca95057f2fb3f0a26
Headers show

Commit Message

Martin Storsjö April 10, 2011, 5:39 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 |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

Comments

Kostya Shishkov April 10, 2011, 5:46 p.m. | #1
On Sun, Apr 10, 2011 at 08:39:43PM +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.
> ---

yes, that looks better
Martin Storsjö April 11, 2011, 8:36 a.m. | #2
On Sun, 10 Apr 2011, Kostya wrote:

> On Sun, Apr 10, 2011 at 08:39:43PM +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.
> > ---
> 
> yes, that looks better

Thanks, pushed.

// Martin

Patch

diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 12561d0..427e9e4 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -1107,6 +1107,7 @@  int av_get_bits_per_sample(enum CodecID codec_id){
     case CODEC_ID_ADPCM_MS:
     case CODEC_ID_ADPCM_YAMAHA:
         return 4;
+    case CODEC_ID_ADPCM_G722:
     case CODEC_ID_PCM_ALAW:
     case CODEC_ID_PCM_MULAW:
     case CODEC_ID_PCM_S8: