faad2/faad2-2.7-mpeg4ip.patch

104 lines
3.7 KiB
Diff
Raw Normal View History

diff -ru faad2-2.7.orig/plugins/mpeg4ip/faad2.cpp faad2-2.7/plugins/mpeg4ip/faad2.cpp
--- faad2-2.7.orig/plugins/mpeg4ip/faad2.cpp 2004-08-20 10:30:53.000000000 +0200
+++ faad2-2.7/plugins/mpeg4ip/faad2.cpp 2009-07-12 19:23:11.000000000 +0200
@@ -35,7 +35,9 @@
/*
* Create CAACodec class
*/
-static codec_data_t *aac_codec_create (const char *compressor,
+static codec_data_t *aac_codec_create (
+ const char *stream_type,
+ const char *compressor,
int type,
int profile,
format_list_t *media_fmt,
@@ -67,7 +69,7 @@
// This is not necessarilly right - it is, for the most part, but
// we should be reading the fmtp statement, and looking at the config.
// (like we do below in the userdata section...
- aac->m_freq = media_fmt->rtpmap->clock_rate;
+ aac->m_freq = media_fmt->rtpmap_clock_rate;
fmtp = parse_fmtp_for_mpeg4(media_fmt->fmt_param, vft->log_msg);
if (fmtp != NULL) {
userdata = fmtp->config_binary;
@@ -148,7 +150,7 @@
* Decode task call for FAAC
*/
static int aac_decode (codec_data_t *ptr,
- uint64_t ts,
+ frame_timestamp_t *ts,
int from_rtp,
int *sync_frame,
uint8_t *buffer,
@@ -163,15 +165,15 @@
if (aac->m_record_sync_time) {
aac->m_current_frame = 0;
aac->m_record_sync_time = 0;
- aac->m_current_time = ts;
- aac->m_last_rtp_ts = ts;
+ aac->m_current_time = ts->msec_timestamp;
+ aac->m_last_rtp_ts = ts->msec_timestamp;
} else {
- if (aac->m_last_rtp_ts == ts) {
+ if (aac->m_last_rtp_ts == ts->msec_timestamp) {
aac->m_current_time += aac->m_msec_per_frame;
aac->m_current_frame++;
} else {
- aac->m_last_rtp_ts = ts;
- aac->m_current_time = ts;
+ aac->m_last_rtp_ts = ts->msec_timestamp;
+ aac->m_current_time = ts->msec_timestamp;
aac->m_current_frame = 0;
}
@@ -239,7 +241,7 @@
aac->m_chans,
(audio_format_t)AUDIO_S16SYS,
aac->m_output_frame_size);
- uint8_t *now = aac->m_vft->audio_get_buffer(aac->m_ifptr);
+ uint8_t *now = aac->m_vft->audio_get_buffer(aac->m_ifptr, aac->m_freq, aac->m_current_time);
aac->m_audio_inited = 1;
}
/*
@@ -281,6 +283,7 @@
};
static int aac_codec_check (lib_message_func_t message,
+ const char *stream_time,
const char *compressor,
int type,
int profile,
@@ -307,9 +310,8 @@
}
}
if (fptr != NULL &&
- fptr->rtpmap != NULL &&
- fptr->rtpmap->encode_name != NULL) {
- if (strcasecmp(fptr->rtpmap->encode_name, "mpeg4-generic") != 0) {
+ fptr->rtpmap_name != NULL) {
+ if (strcasecmp(fptr->rtpmap_name, "mpeg4-generic") != 0) {
return -1;
}
if (userdata == NULL) {
@@ -322,7 +324,7 @@
}
if (userdata != NULL) {
mpeg4_audio_config_t audio_config;
- decode_mpeg4_audio_config(userdata, userdata_size, &audio_config);
+ decode_mpeg4_audio_config(userdata, userdata_size, &audio_config, false);
message(LOG_DEBUG, "aac", "audio type is %d", audio_config.audio_object_type);
if (fmtp != NULL) free_fmtp_parse(fmtp);
diff -ru faad2-2.7.orig/plugins/mpeg4ip/faad2.h faad2-2.7/plugins/mpeg4ip/faad2.h
--- faad2-2.7.orig/plugins/mpeg4ip/faad2.h 2004-01-05 15:05:12.000000000 +0100
+++ faad2-2.7/plugins/mpeg4ip/faad2.h 2009-07-12 19:26:18.000000000 +0200
@@ -81,7 +81,7 @@
int aac_file_next_frame(codec_data_t *ifptr,
uint8_t **buffer,
- uint64_t *ts);
+ frame_timestamp_t *ts);
int aac_file_eof(codec_data_t *ifptr);
void aac_file_used_for_frame(codec_data_t *ifptr,