Skip to content

Commit 965ac3a

Browse files
author
Clement Champetier
committed
VideoDecoder: refactore decodeNextFrame
1 parent 7f9422c commit 965ac3a

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/AvTranscoder/decoder/VideoDecoder.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,11 @@ bool VideoDecoder::decodeNextFrame( Frame& frameBuffer )
6060
if( ! decodeNextFrame() )
6161
return false;
6262

63-
VideoFrame& imageBuffer = static_cast<VideoFrame&>( frameBuffer );
64-
6563
size_t decodedSize = avpicture_get_size( (AVPixelFormat)_frame->format, _frame->width, _frame->height );
66-
if( ! decodedSize )
64+
if( decodedSize == 0 )
6765
return false;
6866

67+
VideoFrame& imageBuffer = static_cast<VideoFrame&>( frameBuffer );
6968
imageBuffer.resize( decodedSize );
7069

7170
// Copy pixel data from an AVPicture into one contiguous buffer.

0 commit comments

Comments
 (0)