42 lines
1.1 KiB
Diff
42 lines
1.1 KiB
Diff
From c488713f91ac67e1a3f046ebe6374c765cf700ce Mon Sep 17 00:00:00 2001
|
|
From: Jeffy Chen <jeffy.chen@rock-chips.com>
|
|
Date: Tue, 6 Apr 2021 10:51:35 +0800
|
|
Subject: [PATCH 1/4] filesrc: Fix stopping race in pull-mode
|
|
|
|
When using qtmultimedia + playbin3, there's a chance that stop() been
|
|
called before fill().
|
|
|
|
Setting uninitialized src fd to -1 instead of 0 to avoid reading the
|
|
stdin in that case.
|
|
|
|
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
|
|
---
|
|
plugins/elements/gstfilesrc.c | 4 ++--
|
|
1 file changed, 2 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/plugins/elements/gstfilesrc.c b/plugins/elements/gstfilesrc.c
|
|
index 5dfe014..08b58db 100644
|
|
--- a/plugins/elements/gstfilesrc.c
|
|
+++ b/plugins/elements/gstfilesrc.c
|
|
@@ -188,7 +188,7 @@ static void
|
|
gst_file_src_init (GstFileSrc * src)
|
|
{
|
|
src->filename = NULL;
|
|
- src->fd = 0;
|
|
+ src->fd = -1;
|
|
src->uri = NULL;
|
|
|
|
src->is_regular = FALSE;
|
|
@@ -604,7 +604,7 @@ gst_file_src_stop (GstBaseSrc * basesrc)
|
|
g_close (src->fd, NULL);
|
|
|
|
/* zero out a lot of our state */
|
|
- src->fd = 0;
|
|
+ src->fd = -1;
|
|
src->is_regular = FALSE;
|
|
|
|
return TRUE;
|
|
--
|
|
2.20.1
|
|
|