mirror of https://git.ffmpeg.org/ffmpeg.git
Merge commit 'db158f0dd217cf839be8af195d66cf49a76537a8'
* commit 'db158f0dd217cf839be8af195d66cf49a76537a8': rtpdec: Remove unnecessary _if_needed suffixes on functions Conflicts: libavformat/rtpdec_xiph.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
commit
a51b192f3b
|
@ -64,7 +64,7 @@ static PayloadContext *jpeg_new_context(void)
|
||||||
return av_mallocz(sizeof(PayloadContext));
|
return av_mallocz(sizeof(PayloadContext));
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void free_frame_if_needed(PayloadContext *jpeg)
|
static inline void free_frame(PayloadContext *jpeg)
|
||||||
{
|
{
|
||||||
if (jpeg->frame) {
|
if (jpeg->frame) {
|
||||||
uint8_t *p;
|
uint8_t *p;
|
||||||
|
@ -76,7 +76,7 @@ static inline void free_frame_if_needed(PayloadContext *jpeg)
|
||||||
|
|
||||||
static void jpeg_free_context(PayloadContext *jpeg)
|
static void jpeg_free_context(PayloadContext *jpeg)
|
||||||
{
|
{
|
||||||
free_frame_if_needed(jpeg);
|
free_frame(jpeg);
|
||||||
av_free(jpeg);
|
av_free(jpeg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -338,7 +338,7 @@ static int jpeg_parse_packet(AVFormatContext *ctx, PayloadContext *jpeg,
|
||||||
|
|
||||||
/* Skip the current frame in case of the end packet
|
/* Skip the current frame in case of the end packet
|
||||||
* has been lost somewhere. */
|
* has been lost somewhere. */
|
||||||
free_frame_if_needed(jpeg);
|
free_frame(jpeg);
|
||||||
|
|
||||||
if ((ret = avio_open_dyn_buf(&jpeg->frame)) < 0)
|
if ((ret = avio_open_dyn_buf(&jpeg->frame)) < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -364,7 +364,7 @@ static int jpeg_parse_packet(AVFormatContext *ctx, PayloadContext *jpeg,
|
||||||
if (jpeg->timestamp != *timestamp) {
|
if (jpeg->timestamp != *timestamp) {
|
||||||
/* Skip the current frame if timestamp is incorrect.
|
/* Skip the current frame if timestamp is incorrect.
|
||||||
* A start packet has been lost somewhere. */
|
* A start packet has been lost somewhere. */
|
||||||
free_frame_if_needed(jpeg);
|
free_frame(jpeg);
|
||||||
av_log(ctx, AV_LOG_ERROR, "RTP timestamps don't match.\n");
|
av_log(ctx, AV_LOG_ERROR, "RTP timestamps don't match.\n");
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,7 +54,7 @@ static PayloadContext *xiph_new_context(void)
|
||||||
return av_mallocz(sizeof(PayloadContext));
|
return av_mallocz(sizeof(PayloadContext));
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void free_fragment_if_needed(PayloadContext * data)
|
static inline void free_fragment(PayloadContext * data)
|
||||||
{
|
{
|
||||||
if (data->fragment) {
|
if (data->fragment) {
|
||||||
uint8_t* p;
|
uint8_t* p;
|
||||||
|
@ -66,7 +66,7 @@ static inline void free_fragment_if_needed(PayloadContext * data)
|
||||||
|
|
||||||
static void xiph_free_context(PayloadContext * data)
|
static void xiph_free_context(PayloadContext * data)
|
||||||
{
|
{
|
||||||
free_fragment_if_needed(data);
|
free_fragment(data);
|
||||||
av_freep(&data->split_buf);
|
av_freep(&data->split_buf);
|
||||||
av_freep(&data);
|
av_freep(&data);
|
||||||
}
|
}
|
||||||
|
@ -183,7 +183,7 @@ static int xiph_handle_packet(AVFormatContext *ctx, PayloadContext *data,
|
||||||
int res;
|
int res;
|
||||||
|
|
||||||
// end packet has been lost somewhere, so drop buffered data
|
// end packet has been lost somewhere, so drop buffered data
|
||||||
free_fragment_if_needed(data);
|
free_fragment(data);
|
||||||
|
|
||||||
if((res = avio_open_dyn_buf(&data->fragment)) < 0)
|
if((res = avio_open_dyn_buf(&data->fragment)) < 0)
|
||||||
return res;
|
return res;
|
||||||
|
@ -196,7 +196,7 @@ static int xiph_handle_packet(AVFormatContext *ctx, PayloadContext *data,
|
||||||
if (data->timestamp != *timestamp) {
|
if (data->timestamp != *timestamp) {
|
||||||
// skip if fragmented timestamp is incorrect;
|
// skip if fragmented timestamp is incorrect;
|
||||||
// a start packet has been lost somewhere
|
// a start packet has been lost somewhere
|
||||||
free_fragment_if_needed(data);
|
free_fragment(data);
|
||||||
av_log(ctx, AV_LOG_ERROR, "RTP timestamps don't match!\n");
|
av_log(ctx, AV_LOG_ERROR, "RTP timestamps don't match!\n");
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue