mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-20 16:51:10 +00:00
gst-libs/gst/app/gstappsrc.c (gst_app_src_set_max_bytes)
Original commit message from CVS: 2008-06-16 Andy Wingo <wingo@pobox.com> * gst-libs/gst/app/gstappsrc.c (gst_app_src_set_max_bytes) (gst_app_src_get_max_bytes, gst_app_src_push_buffer): Use G_GUINT64_FORMAT. Avoid overflow in get_max_bytes().
This commit is contained in:
parent
04c53e454a
commit
004d1d0f9f
2 changed files with 11 additions and 5 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2008-06-16 Andy Wingo <wingo@pobox.com>
|
||||||
|
|
||||||
|
* gst-libs/gst/app/gstappsrc.c (gst_app_src_set_max_bytes)
|
||||||
|
(gst_app_src_get_max_bytes, gst_app_src_push_buffer): Use
|
||||||
|
G_GUINT64_FORMAT. Avoid overflow in get_max_bytes().
|
||||||
|
|
||||||
2008-06-16 Stefan Kost <ensonic@users.sf.net>
|
2008-06-16 Stefan Kost <ensonic@users.sf.net>
|
||||||
|
|
||||||
* sys/dvb/gstdvbsrc.c:
|
* sys/dvb/gstdvbsrc.c:
|
||||||
|
|
|
@ -820,7 +820,7 @@ gst_app_src_set_max_bytes (GstAppSrc * appsrc, guint64 max)
|
||||||
|
|
||||||
g_mutex_lock (appsrc->mutex);
|
g_mutex_lock (appsrc->mutex);
|
||||||
if (max != appsrc->max_bytes) {
|
if (max != appsrc->max_bytes) {
|
||||||
GST_DEBUG_OBJECT (appsrc, "setting max-bytes to %u", max);
|
GST_DEBUG_OBJECT (appsrc, "setting max-bytes to %" G_GUINT64_FORMAT, max);
|
||||||
appsrc->max_bytes = max;
|
appsrc->max_bytes = max;
|
||||||
/* signal the change */
|
/* signal the change */
|
||||||
g_cond_broadcast (appsrc->cond);
|
g_cond_broadcast (appsrc->cond);
|
||||||
|
@ -839,13 +839,13 @@ gst_app_src_set_max_bytes (GstAppSrc * appsrc, guint64 max)
|
||||||
guint64
|
guint64
|
||||||
gst_app_src_get_max_bytes (GstAppSrc * appsrc)
|
gst_app_src_get_max_bytes (GstAppSrc * appsrc)
|
||||||
{
|
{
|
||||||
guint result;
|
guint64 result;
|
||||||
|
|
||||||
g_return_val_if_fail (GST_IS_APP_SRC (appsrc), 0);
|
g_return_val_if_fail (GST_IS_APP_SRC (appsrc), 0);
|
||||||
|
|
||||||
g_mutex_lock (appsrc->mutex);
|
g_mutex_lock (appsrc->mutex);
|
||||||
result = appsrc->max_bytes;
|
result = appsrc->max_bytes;
|
||||||
GST_DEBUG_OBJECT (appsrc, "getting max-bytes of %u", result);
|
GST_DEBUG_OBJECT (appsrc, "getting max-bytes of %" G_GUINT64_FORMAT, result);
|
||||||
g_mutex_unlock (appsrc->mutex);
|
g_mutex_unlock (appsrc->mutex);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
@ -883,8 +883,8 @@ gst_app_src_push_buffer (GstAppSrc * appsrc, GstBuffer * buffer)
|
||||||
goto eos;
|
goto eos;
|
||||||
|
|
||||||
if (appsrc->queued_bytes >= appsrc->max_bytes) {
|
if (appsrc->queued_bytes >= appsrc->max_bytes) {
|
||||||
GST_DEBUG_OBJECT (appsrc, "queue filled (%u >= %u)",
|
GST_DEBUG_OBJECT (appsrc, "queue filled (%" G_GUINT64_FORMAT " >= %"
|
||||||
appsrc->queued_bytes, appsrc->max_bytes);
|
G_GUINT64_FORMAT ")", appsrc->queued_bytes, appsrc->max_bytes);
|
||||||
|
|
||||||
if (first) {
|
if (first) {
|
||||||
/* only signal on the first push */
|
/* only signal on the first push */
|
||||||
|
|
Loading…
Reference in a new issue