Fix bug caused by difference in stride and picture width.

When a frame is allocated using libschroedinger routines, the frame data size
does not match the actual frame size if the width is not a multiple of 16. So
we cannot do a straightforward memcpy of the frame returned by libschroedinger
into the FFmpeg picture as the stride differs from the width.

Fix this bug by allocating for the libschroedinger frame with the dimensions
in AVCodecContext within libavcodec and passing the frame to libschroedinger.

patch by Anuradha Suraparaju, anuradha rd.bbc.co uk

Originally committed as revision 19653 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Anuradha Suraparaju
2009-08-15 11:59:53 +00:00
committed by Diego Biurrun
parent 0ebe3b8e2b
commit d15f2e00c5
4 changed files with 68 additions and 13 deletions

View File

@@ -256,11 +256,8 @@ static int libschroedinger_decode_frame(AVCodecContext *avccontext,
case SCHRO_DECODER_NEED_FRAME:
/* Decoder needs a frame - create one and push it in. */
frame = schro_frame_new_and_alloc(NULL,
p_schro_params->frame_format,
format->width,
format->height);
frame = ff_create_schro_frame(avccontext,
p_schro_params->frame_format);
schro_decoder_add_output_picture(decoder, frame);
break;