return S_OK;
}
+ const int i_width = videoFrame->GetWidth();
+ const int i_height = videoFrame->GetHeight();
+ const int i_stride = videoFrame->GetRowBytes();
+ const int i_bpp = 2;
+
block_t *p_frame;
- p_frame = block_New( p_demux_, 720 * 576 * 3 );
+ p_frame = block_New( p_demux_, i_width * i_height * i_bpp );
if( !p_frame )
{
msg_Err( p_demux_, "Could not allocate memory for frame" );
void *frame_bytes;
videoFrame->GetBytes( &frame_bytes );
- memcpy( p_frame->p_buffer, frame_bytes, 720 * 576 * 3 );
+ for( int y = 0; y < i_height; ++y )
+ {
+ const uint8_t *src = (const uint8_t *)frame_bytes + i_stride * y;
+ uint8_t *dst = (uint8_t *)p_frame->p_buffer + i_width * i_bpp * y;
+ memcpy( dst, src, i_width * i_bpp );
+ }
BMDTimeValue stream_time, frame_duration;
videoFrame->GetStreamTime( &stream_time, &frame_duration, CLOCK_FREQ );