Commit 17384b17 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit '5e5583ef'

* commit '5e5583ef':
  libavformat: add AC3 RTP depacketization (RFC 4184)

Conflicts:
	Changelog
	libavformat/rtpdec_ac3.c
	libavformat/version.h

See: 3eec775bMerged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 285eea00 5e5583ef
......@@ -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
......
......@@ -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,7 +57,7 @@ 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);
}
......@@ -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, \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment