1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
|
Description: Fix FTBFS with ffmpeg/5.0.
Bug-Debian: https://bugs.debian.org/1004766
Author: Yavor Doganov <yavor@gnu.org>
Forwarded: no
Last-Update: 2024-01-14
---
--- lynkeos.app.orig/application/Sources/FFmpegReader.h
+++ lynkeos.app/application/Sources/FFmpegReader.h
@@ -74,7 +74,7 @@
u_short *_convBuffer; //!< Temporary buffer for conversion
int _bufLineLength; //<! Temporary buffer line length for each plane
int _videoStream; //!< Index of the selected video stream
- AVPacket _packet; //!< Last packet read
+ AVPacket *_packet; //!< Last packet read
DecoderState_t _decoderState; //! State of the decoder with respect to packet data
u_long _numberOfFrames; //!< Number of image frames in the movie
KeyFrames_t *_times; //!< Times of key frames
--- lynkeos.app.orig/application/Sources/FFmpegReader.m
+++ lynkeos.app/application/Sources/FFmpegReader.m
@@ -113,12 +113,12 @@
do
{
// Free old packet content
- av_packet_unref( &_packet );
+ av_packet_unref( _packet );
// Read new packet
- ret = av_read_frame(_pFormatCtx, &_packet);
+ ret = av_read_frame(_pFormatCtx, _packet);
- } while( ret >= 0 && (_packet.stream_index != _videoStream ) );
+ } while( ret >= 0 && (_packet->stream_index != _videoStream ) );
if ( ret < 0 )
{
@@ -136,7 +136,7 @@
{
case DataNeeded:
case DataRepeat:
- pk = &_packet;
+ pk = _packet;
break;
case EndOfFile:
// We will send a *last* NULL packet
@@ -213,9 +213,9 @@
|| _times[index].keyFrame != _times[_nextIndex].keyFrame )
{
// Reset the decoder
- if ( _packet.data != NULL )
- av_packet_unref( &_packet );
- _packet.size = 0;
+ if ( _packet->data != NULL )
+ av_packet_unref( _packet );
+ _packet->size = 0;
avcodec_flush_buffers(_pCodecCtx);
_decoderState = DataNeeded;
@@ -337,9 +337,7 @@
_convBuffer = NULL;
_bufLineLength = 0;
_videoStream = -1;
- av_init_packet(&_packet);
- _packet.data = NULL;
- _packet.size = 0;
+ _packet = av_packet_alloc();
_decoderState = DataNeeded;
_numberOfFrames = 0;
_nextIndex = 0;
@@ -538,8 +536,7 @@
sws_freeContext( _procConverter );
if (_convBuffer != NULL)
free(_convBuffer);
- if ( _packet.data != NULL )
- av_packet_unref( &_packet );
+ av_packet_free( &_packet );
if ( _pFormatCtx != NULL )
avformat_close_input( &_pFormatCtx );
if ( _times != NULL )
|