#define NAME_LONGTEXT N_( \
"This is the name of the session that will be announced in the SDP " \
"(Session Descriptor)." )
+#define CAT_TEXT N_("Session category")
+#define CAT_LONGTEXT N_( \
+ "This allows you to specify a category for the session, " \
+ "that will be announced if you choose to use SAP." )
#define DESC_TEXT N_("Session description")
#define DESC_LONGTEXT N_( \
"This allows you to give a short description with details about the stream, " \
add_string( SOUT_CFG_PREFIX "name", "", NAME_TEXT,
NAME_LONGTEXT, true )
+ add_string( SOUT_CFG_PREFIX "cat", "", CAT_TEXT, CAT_LONGTEXT, true )
add_string( SOUT_CFG_PREFIX "description", "", DESC_TEXT,
DESC_LONGTEXT, true )
add_string( SOUT_CFG_PREFIX "url", "", URL_TEXT,
* Exported prototypes
*****************************************************************************/
static const char *const ppsz_sout_options[] = {
- "dst", "name", "port", "port-audio", "port-video", "*sdp", "ttl", "mux",
- "sap", "description", "url", "email", "phone",
+ "dst", "name", "cat", "port", "port-audio", "port-video", "*sdp", "ttl",
+ "mux", "sap", "description", "url", "email", "phone",
"proto", "rtcp-mux", "caching",
#ifdef HAVE_SRTP
"key", "salt",
uint32_t rtp_compute_ts( unsigned i_clock_rate, int64_t i_pts )
{
- /* NOTE: this plays nice with offsets because the calculations are
- * linear. */
- return i_pts * (int64_t)i_clock_rate / CLOCK_FREQ;
+ /* This is an overflow-proof way of doing:
+ * return i_pts * (int64_t)i_clock_rate / CLOCK_FREQ;
+ *
+ * NOTE: this plays nice with offsets because the (equivalent)
+ * calculations are linear. */
+ lldiv_t q = lldiv(i_pts, CLOCK_FREQ);
+ return q.quot * (int64_t)i_clock_rate
+ + q.rem * (int64_t)i_clock_rate / CLOCK_FREQ;
}
/** Add an ES as a new RTP stream */
/* As per RFC 2326, session identifiers are at least 8 bytes long */
strncpy((char *)&i_ts_init, psz_vod_session, sizeof(uint64_t));
i_ts_init ^= (uintptr_t)p_media;
- /* Limit the timestamp to 48 bytes, this is enough and allows us
+ /* Limit the timestamp to 48 bits, this is enough and allows us
* to stay away from overflows */
i_ts_init &= 0xFFFFFFFFFFFF;
return i_ts_init;