mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-25 09:40:37 +00:00
Make sure the widget gets updated even if the slider value doesn't change.
Original commit message from CVS: Make sure the widget gets updated even if the slider value doesn't change.
This commit is contained in:
parent
15e3042d5f
commit
18d8d12679
2 changed files with 10 additions and 4 deletions
|
@ -11,6 +11,7 @@ static GList *seekable_elements = NULL;
|
||||||
static GstElement *pipeline;
|
static GstElement *pipeline;
|
||||||
static guint64 duration;
|
static guint64 duration;
|
||||||
static GtkAdjustment *adjustment;
|
static GtkAdjustment *adjustment;
|
||||||
|
static GtkWidget *hscale;
|
||||||
static gboolean stats = FALSE;
|
static gboolean stats = FALSE;
|
||||||
static gboolean elem_seek = FALSE;
|
static gboolean elem_seek = FALSE;
|
||||||
static gboolean verbose = FALSE;
|
static gboolean verbose = FALSE;
|
||||||
|
@ -789,9 +790,12 @@ update_scale (gpointer data)
|
||||||
}
|
}
|
||||||
query_rates ();
|
query_rates ();
|
||||||
}
|
}
|
||||||
|
if (position >= duration)
|
||||||
|
duration = position;
|
||||||
|
|
||||||
if (duration > 0) {
|
if (duration > 0) {
|
||||||
gtk_adjustment_set_value (adjustment, position * 100.0 / duration);
|
gtk_adjustment_set_value (adjustment, position * 100.0 / duration);
|
||||||
|
gtk_widget_queue_draw (hscale);
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -945,8 +949,7 @@ print_usage (int argc, char **argv)
|
||||||
int
|
int
|
||||||
main (int argc, char **argv)
|
main (int argc, char **argv)
|
||||||
{
|
{
|
||||||
GtkWidget *window, *hbox, *vbox,
|
GtkWidget *window, *hbox, *vbox, *play_button, *pause_button, *stop_button;
|
||||||
*play_button, *pause_button, *stop_button, *hscale;
|
|
||||||
struct poptOption options[] = {
|
struct poptOption options[] = {
|
||||||
{"stats", 's', POPT_ARG_NONE | POPT_ARGFLAG_STRIP, &stats, 0,
|
{"stats", 's', POPT_ARG_NONE | POPT_ARGFLAG_STRIP, &stats, 0,
|
||||||
"Show pad stats", NULL},
|
"Show pad stats", NULL},
|
||||||
|
|
|
@ -11,6 +11,7 @@ static GList *seekable_elements = NULL;
|
||||||
static GstElement *pipeline;
|
static GstElement *pipeline;
|
||||||
static guint64 duration;
|
static guint64 duration;
|
||||||
static GtkAdjustment *adjustment;
|
static GtkAdjustment *adjustment;
|
||||||
|
static GtkWidget *hscale;
|
||||||
static gboolean stats = FALSE;
|
static gboolean stats = FALSE;
|
||||||
static gboolean elem_seek = FALSE;
|
static gboolean elem_seek = FALSE;
|
||||||
static gboolean verbose = FALSE;
|
static gboolean verbose = FALSE;
|
||||||
|
@ -789,9 +790,12 @@ update_scale (gpointer data)
|
||||||
}
|
}
|
||||||
query_rates ();
|
query_rates ();
|
||||||
}
|
}
|
||||||
|
if (position >= duration)
|
||||||
|
duration = position;
|
||||||
|
|
||||||
if (duration > 0) {
|
if (duration > 0) {
|
||||||
gtk_adjustment_set_value (adjustment, position * 100.0 / duration);
|
gtk_adjustment_set_value (adjustment, position * 100.0 / duration);
|
||||||
|
gtk_widget_queue_draw (hscale);
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -945,8 +949,7 @@ print_usage (int argc, char **argv)
|
||||||
int
|
int
|
||||||
main (int argc, char **argv)
|
main (int argc, char **argv)
|
||||||
{
|
{
|
||||||
GtkWidget *window, *hbox, *vbox,
|
GtkWidget *window, *hbox, *vbox, *play_button, *pause_button, *stop_button;
|
||||||
*play_button, *pause_button, *stop_button, *hscale;
|
|
||||||
struct poptOption options[] = {
|
struct poptOption options[] = {
|
||||||
{"stats", 's', POPT_ARG_NONE | POPT_ARGFLAG_STRIP, &stats, 0,
|
{"stats", 's', POPT_ARG_NONE | POPT_ARGFLAG_STRIP, &stats, 0,
|
||||||
"Show pad stats", NULL},
|
"Show pad stats", NULL},
|
||||||
|
|
Loading…
Reference in a new issue