mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
abstract/fixed/adpative jitter buffer: disallow frame re-inserts
It was possible for a frame to be re-inserted into a jitter buffer after it had been removed from it. A case when this happened was if a frame was read out of the jitterbuffer, passed to the translation core, and then multiple frames were returned from said translation core. Upon multiple frames being returned the first is passed on, but sebsequently "chained" frames are put back into the read queue. Thus it was possible for a frame to go back into the jitter buffer where this would cause problems. This patch adds a flag to frames that are inserted into the channel's read queue after translation. The abstract jitter buffer code then checks for this flag and ignores any frames marked as such. Change-Id: I276c44edc9dcff61e606242f71274265c7779587
This commit is contained in:
@@ -109,6 +109,8 @@ typedef int (*jb_remove_impl)(void *jb, struct ast_frame **fout);
|
||||
typedef void (*jb_force_resynch_impl)(void *jb);
|
||||
/*! \brief Empty and reset jb */
|
||||
typedef void (*jb_empty_and_reset_impl)(void *jb);
|
||||
/*! \brief Check if late */
|
||||
typedef int (*jb_is_late_impl)(void *jb, long ts);
|
||||
|
||||
|
||||
/*!
|
||||
@@ -127,6 +129,7 @@ struct ast_jb_impl
|
||||
jb_remove_impl remove;
|
||||
jb_force_resynch_impl force_resync;
|
||||
jb_empty_and_reset_impl empty_and_reset;
|
||||
jb_is_late_impl is_late;
|
||||
};
|
||||
|
||||
/*!
|
||||
|
@@ -133,6 +133,8 @@ enum ast_frame_type {
|
||||
enum {
|
||||
/*! This frame contains valid timing information */
|
||||
AST_FRFLAG_HAS_TIMING_INFO = (1 << 0),
|
||||
/*! This frame has been requeued */
|
||||
AST_FRFLAG_REQUEUED = (1 << 1),
|
||||
};
|
||||
|
||||
struct ast_frame_subclass {
|
||||
|
@@ -166,6 +166,9 @@ enum jb_return_code jb_setconf(jitterbuf *jb, jb_conf *conf);
|
||||
typedef void __attribute__((format(printf, 1, 2))) (*jb_output_function_t)(const char *fmt, ...);
|
||||
void jb_setoutput(jb_output_function_t err, jb_output_function_t warn, jb_output_function_t dbg);
|
||||
|
||||
/*! \brief Checks if the given time stamp is late */
|
||||
int jb_is_late(jitterbuf *jb, long ts);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user