Zebediah Figura : winegstreamer: Don't try to convert duration from byte length.

Alexandre Julliard julliard at winehq.org
Thu Jul 22 16:28:18 CDT 2021


Module: wine
Branch: master
Commit: ddf3b93ac184a7e707b13f2793d450e40c2b85f7
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=ddf3b93ac184a7e707b13f2793d450e40c2b85f7

Author: Zebediah Figura <zfigura at codeweavers.com>
Date:   Thu Jul 22 00:19:03 2021 -0500

winegstreamer: Don't try to convert duration from byte length.

This effectively reverts 613446d018b792b10d067314831901437b4ff6e5.

Duration and convert queries, in general, appear to be handled by the first
upstream element that knows how. If two different elements respond to each
query, we may treat the byte duration of the whole file as if it were the
duration of a single stream, or treat an undecoded byte duration as if it were a
decoded byte duration.

The aforementioned commit was written in order to ensure that we receive a valid
duration for test.mp3 in quartz_test.exe, and is obviated by the previous
patches which retry duration queries until successful (or EOS).

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51126
Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/winegstreamer/wg_parser.c | 14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)

diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c
index eb53ac8efce..cd12a23d0c8 100644
--- a/dlls/winegstreamer/wg_parser.c
+++ b/dlls/winegstreamer/wg_parser.c
@@ -1525,7 +1525,7 @@ static HRESULT CDECL wg_parser_connect(struct wg_parser *parser, uint64_t file_s
     for (i = 0; i < parser->stream_count; ++i)
     {
         struct wg_parser_stream *stream = parser->streams[i];
-        gint64 duration, byte_length;
+        gint64 duration;
 
         while (!stream->has_caps && !parser->error)
             pthread_cond_wait(&parser->init_cond, &parser->mutex);
@@ -1567,18 +1567,6 @@ static HRESULT CDECL wg_parser_connect(struct wg_parser *parser, uint64_t file_s
                 break;
             }
 
-            GST_INFO("Failed to query time duration; trying to convert from byte length.\n");
-
-            /* To accurately get a duration for the stream, we want to only
-             * consider the length of that stream. Hence, query for the pad
-             * duration, instead of using the file duration. */
-            if (gst_pad_query_duration(stream->their_src, GST_FORMAT_BYTES, &byte_length)
-                    && gst_pad_query_convert(stream->their_src, GST_FORMAT_BYTES, byte_length,
-                            GST_FORMAT_TIME, &duration))
-            {
-                stream->duration = duration / 100;
-                break;
-            }
             if (stream->eos)
             {
                 stream->duration = 0;




More information about the wine-cvs mailing list