forked from AuroraMiddleware/gtk
mediafile: Check if media files are open when trying to play
If no file is open, refuse to play.
This commit is contained in:
parent
3ca59b8701
commit
e665667bff
@ -656,6 +656,9 @@ gtk_ff_media_file_play (GtkMediaStream *stream)
|
||||
{
|
||||
GtkFfMediaFile *video = GTK_FF_MEDIA_FILE (stream);
|
||||
|
||||
if (video->format_ctx == NULL)
|
||||
return FALSE;
|
||||
|
||||
if (!gtk_media_stream_is_prepared (stream))
|
||||
return TRUE;
|
||||
|
||||
|
@ -245,6 +245,9 @@ gtk_gst_media_file_play (GtkMediaStream *stream)
|
||||
{
|
||||
GtkGstMediaFile *self = GTK_GST_MEDIA_FILE (stream);
|
||||
|
||||
if (self->player == NULL)
|
||||
return FALSE;
|
||||
|
||||
gst_player_play (self->player);
|
||||
|
||||
return TRUE;
|
||||
|
Loading…
Reference in New Issue
Block a user