mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
Merge commit '5e5583efe41662294c5e1b76499ba338557f808d'
* commit '5e5583efe41662294c5e1b76499ba338557f808d':
libavformat: add AC3 RTP depacketization (RFC 4184)
Conflicts:
Changelog
libavformat/rtpdec_ac3.c
libavformat/version.h
See: 3eec775b21
Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
commit
17384b1719
@ -24,7 +24,7 @@ version <next>:
|
||||
- ported softpulldown filter from libmpcodecs as repeatfields filter
|
||||
- dcshift filter
|
||||
- RTP parser for loss tolerant payload format for MP3 audio (RFC 5219)
|
||||
- RTP parser for AC3 payload format (RFC 4184)
|
||||
- RTP depacketizer for AC3 payload format (RFC 4184)
|
||||
- palettegen and paletteuse filters
|
||||
- VP9 RTP payload format (draft 0) experimental depacketizer
|
||||
- DV RTP payload format (RFC 6469) depacketizer
|
||||
|
@ -32,7 +32,7 @@ struct PayloadContext {
|
||||
};
|
||||
|
||||
static av_cold int ac3_init(AVFormatContext *s, int st_index,
|
||||
PayloadContext *data)
|
||||
PayloadContext *data)
|
||||
{
|
||||
if (st_index < 0)
|
||||
return 0;
|
||||
@ -45,7 +45,7 @@ static PayloadContext *ac3_new_context(void)
|
||||
return av_mallocz(sizeof(PayloadContext));
|
||||
}
|
||||
|
||||
static inline void free_fragment_if_needed(PayloadContext *data)
|
||||
static void free_fragment(PayloadContext *data)
|
||||
{
|
||||
if (data->fragment) {
|
||||
uint8_t *p;
|
||||
@ -57,14 +57,14 @@ static inline void free_fragment_if_needed(PayloadContext *data)
|
||||
|
||||
static void ac3_free_context(PayloadContext *data)
|
||||
{
|
||||
free_fragment_if_needed(data);
|
||||
free_fragment(data);
|
||||
av_free(data);
|
||||
}
|
||||
|
||||
static int ac3_handle_packet(AVFormatContext *ctx, PayloadContext *data,
|
||||
AVStream *st, AVPacket *pkt, uint32_t *timestamp,
|
||||
const uint8_t *buf, int len, uint16_t seq,
|
||||
int flags)
|
||||
AVStream *st, AVPacket *pkt, uint32_t *timestamp,
|
||||
const uint8_t *buf, int len, uint16_t seq,
|
||||
int flags)
|
||||
{
|
||||
unsigned frame_type;
|
||||
unsigned nr_frames;
|
||||
@ -97,7 +97,7 @@ static int ac3_handle_packet(AVFormatContext *ctx, PayloadContext *data,
|
||||
|
||||
case 1:
|
||||
case 2: /* First fragment */
|
||||
free_fragment_if_needed(data);
|
||||
free_fragment(data);
|
||||
|
||||
data->last_frame = 1;
|
||||
data->nr_frames = nr_frames;
|
||||
@ -117,7 +117,7 @@ static int ac3_handle_packet(AVFormatContext *ctx, PayloadContext *data,
|
||||
}
|
||||
if (nr_frames != data->nr_frames ||
|
||||
data->timestamp != *timestamp) {
|
||||
free_fragment_if_needed(data);
|
||||
free_fragment(data);
|
||||
av_log(ctx, AV_LOG_ERROR, "Invalid packet received\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
@ -130,7 +130,7 @@ static int ac3_handle_packet(AVFormatContext *ctx, PayloadContext *data,
|
||||
return AVERROR(EAGAIN);
|
||||
|
||||
if (data->last_frame != data->nr_frames) {
|
||||
free_fragment_if_needed(data);
|
||||
free_fragment(data);
|
||||
av_log(ctx, AV_LOG_ERROR, "Missed %d packets\n",
|
||||
data->nr_frames - data->last_frame);
|
||||
return AVERROR_INVALIDDATA;
|
||||
@ -139,7 +139,7 @@ static int ac3_handle_packet(AVFormatContext *ctx, PayloadContext *data,
|
||||
err = ff_rtp_finalize_packet(pkt, &data->fragment, st->index);
|
||||
if (err < 0) {
|
||||
av_log(ctx, AV_LOG_ERROR,
|
||||
"Error occurred when getting fragment buffer.");
|
||||
"Error occurred when getting fragment buffer.\n");
|
||||
return err;
|
||||
}
|
||||
|
||||
|
@ -30,8 +30,9 @@
|
||||
#include "libavutil/version.h"
|
||||
|
||||
#define LIBAVFORMAT_VERSION_MAJOR 56
|
||||
|
||||
#define LIBAVFORMAT_VERSION_MINOR 23
|
||||
#define LIBAVFORMAT_VERSION_MICRO 101
|
||||
#define LIBAVFORMAT_VERSION_MICRO 102
|
||||
|
||||
#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
|
||||
LIBAVFORMAT_VERSION_MINOR, \
|
||||
|
Loading…
Reference in New Issue
Block a user