[FFmpeg-cvslog] WMAL: do not start decoding if frame does not end in current packet
Mashiat Sarker Shakkhar
git at videolan.org
Tue May 1 22:19:18 CEST 2012
ffmpeg | branch: master | Mashiat Sarker Shakkhar <mashiat.sarker at gmail.com> | Mon Apr 30 08:56:35 2012 -0700| [f92f4523782be96cd80b4d94d2642d12dd42cf00] | committer: Kostya Shishkov
WMAL: do not start decoding if frame does not end in current packet
This fixes decoding of frames which span more than two packets. Tested with
recit24.wma.
Signed-off-by: Kostya Shishkov <kostya.shishkov at gmail.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f92f4523782be96cd80b4d94d2642d12dd42cf00
---
libavcodec/wmalosslessdec.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/libavcodec/wmalosslessdec.c b/libavcodec/wmalosslessdec.c
index 1520a06..e86645e 100644
--- a/libavcodec/wmalosslessdec.c
+++ b/libavcodec/wmalosslessdec.c
@@ -1209,8 +1209,8 @@ 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 && !s->packet_loss)
+ decode_frame(s);
} 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);
More information about the ffmpeg-cvslog
mailing list