On Sat, Apr 28, 2012 at 11:24:18AM -0700, Mashiat Sarker Shakkhar wrote:
> This fixes decoding of frames which span more than two packets. Tested with
> recit24.wma.
> ---
>  libavcodec/wmalosslessdec.c |    7 +++++--
>  1 files changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/libavcodec/wmalosslessdec.c b/libavcodec/wmalosslessdec.c
> index 1520a06..bc1a19c 100644
> --- a/libavcodec/wmalosslessdec.c
> +++ b/libavcodec/wmalosslessdec.c
> @@ -1209,8 +1209,11 @@ static int decode_packet(AVCodecContext *avctx, void 
> *data, int *got_frame_ptr,
>              save_bits(s, gb, num_bits_prev_frame, 1);
>  
>              /* decode the cross packet frame if it is valid */
> -            if (!s->packet_loss)
> -                decode_frame(s);
> +            if (num_bits_prev_frame < remaining_packet_bits)
> +                if (!s->packet_loss)
> +                    decode_frame(s);
> +            else
> +                s->packet_done = 1;
>          } else if (s->num_saved_bits - s->frame_offset) {
>              av_dlog(avctx, "ignoring %x previously saved bits\n",
>                      s->num_saved_bits - s->frame_offset);
> -- 

approach seems OK but please add braces
it's not Python and it will compile to 
if(num_bits){
 if(!s->packet_loss)
  ...
 else
  ...
}
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to