|
@@ -16,6 +16,7 @@
|
|
******************************************************************************/
|
|
******************************************************************************/
|
|
|
|
|
|
#include "ffmpeg-decode.h"
|
|
#include "ffmpeg-decode.h"
|
|
|
|
+#include "obs-ffmpeg-compat.h"
|
|
#include <obs-avc.h>
|
|
#include <obs-avc.h>
|
|
|
|
|
|
int ffmpeg_decode_init(struct ffmpeg_decode *decode, enum AVCodecID id)
|
|
int ffmpeg_decode_init(struct ffmpeg_decode *decode, enum AVCodecID id)
|
|
@@ -37,8 +38,8 @@ int ffmpeg_decode_init(struct ffmpeg_decode *decode, enum AVCodecID id)
|
|
return ret;
|
|
return ret;
|
|
}
|
|
}
|
|
|
|
|
|
- if (decode->codec->capabilities & CODEC_CAP_TRUNCATED)
|
|
|
|
- decode->decoder->flags |= CODEC_FLAG_TRUNCATED;
|
|
|
|
|
|
+ if (decode->codec->capabilities & CODEC_CAP_TRUNC)
|
|
|
|
+ decode->decoder->flags |= CODEC_FLAG_TRUNC;
|
|
|
|
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
@@ -96,7 +97,7 @@ static inline enum audio_format convert_sample_format(int f)
|
|
static inline void copy_data(struct ffmpeg_decode *decode, uint8_t *data,
|
|
static inline void copy_data(struct ffmpeg_decode *decode, uint8_t *data,
|
|
size_t size)
|
|
size_t size)
|
|
{
|
|
{
|
|
- size_t new_size = size + FF_INPUT_BUFFER_PADDING_SIZE;
|
|
|
|
|
|
+ size_t new_size = size + INPUT_BUFFER_PADDING_SIZE;
|
|
|
|
|
|
if (decode->packet_size < new_size) {
|
|
if (decode->packet_size < new_size) {
|
|
decode->packet_buffer = brealloc(decode->packet_buffer,
|
|
decode->packet_buffer = brealloc(decode->packet_buffer,
|
|
@@ -104,7 +105,7 @@ static inline void copy_data(struct ffmpeg_decode *decode, uint8_t *data,
|
|
decode->packet_size = new_size;
|
|
decode->packet_size = new_size;
|
|
}
|
|
}
|
|
|
|
|
|
- memset(decode->packet_buffer + size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
|
|
|
|
|
|
+ memset(decode->packet_buffer + size, 0, INPUT_BUFFER_PADDING_SIZE);
|
|
memcpy(decode->packet_buffer, data, size);
|
|
memcpy(decode->packet_buffer, data, size);
|
|
}
|
|
}
|
|
|
|
|