Skip to content

Commit c4d4fe8

Browse files
author
Clement Champetier
committed
Frame: avoid using of av_copy_packet
* av_copy_packet: not available on ubuntu 14.04 * Fix #86
1 parent b6ed98d commit c4d4fe8

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/AvTranscoder/frame/Frame.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,13 @@ Frame::Frame( const size_t dataSize )
1515

1616
Frame::Frame(AVPacket& avPacket)
1717
{
18+
#if LIBAVCODEC_VERSION_MAJOR > 54 || ( LIBAVCODEC_VERSION_MAJOR == 54 && LIBAVCODEC_VERSION_MINOR > 56 )
1819
av_copy_packet( &_packet, &avPacket );
20+
#else
21+
// we just care about data, not side properties of AVPacket
22+
initAVPacket();
23+
copyData( avPacket.data, avPacket.size );
24+
#endif
1925
}
2026

2127
Frame::~Frame()

src/AvTranscoder/frame/Frame.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class AvExport Frame
1919
/// Create a frame with a the given buffer size
2020
Frame( const size_t dataSize );
2121

22-
/// Create a frame from the given AVPAcket (copy data)
22+
/// Create a frame from the given AVPAcket (copy data of given packet)
2323
Frame( AVPacket& avPacket );
2424

2525
/// Free buffer of data

0 commit comments

Comments
 (0)