aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/rtpdec_ac3.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-02-22 00:46:22 +0100
committerMichael Niedermayer <michaelni@gmx.at>2015-02-22 00:48:27 +0100
commit17384b1719807b42943bc8e481133d34fb05d9a5 (patch)
treea99df30eb2e9aced570bab58b18d818f2f9931e1 /libavformat/rtpdec_ac3.c
parent285eea00013f774cc935137a2e73a8f6ffb4e236 (diff)
parent5e5583efe41662294c5e1b76499ba338557f808d (diff)
downloadffmpeg-17384b1719807b42943bc8e481133d34fb05d9a5.tar.gz
Merge commit '5e5583efe41662294c5e1b76499ba338557f808d'
* commit '5e5583efe41662294c5e1b76499ba338557f808d': libavformat: add AC3 RTP depacketization (RFC 4184) Conflicts: Changelog libavformat/rtpdec_ac3.c libavformat/version.h See: 3eec775b211c5fd00300e2042ae8f116293e5d55 Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/rtpdec_ac3.c')
-rw-r--r--libavformat/rtpdec_ac3.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/libavformat/rtpdec_ac3.c b/libavformat/rtpdec_ac3.c
index 7454a9af13..05abf4042e 100644
--- a/libavformat/rtpdec_ac3.c
+++ b/libavformat/rtpdec_ac3.c
@@ -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;
}