From: <wt...@fr...> - 2004-09-24 16:38:42
|
CVS Root: /cvs/gstreamer Module: gst-plugins Changes by: wtay Date: Fri Sep 24 2004 09:38:40 PDT Log message: * gst/playback/gstplaybasebin.c: (remove_prerolls), (new_decoded_pad): * gst/playback/gstplaybasebin.h: * gst/playback/gstplaybin.c: (setup_sinks): Don't try to preroll or decode more than one audio/video track. Modified files: . : ChangeLog gst/playback : gstplaybasebin.c gstplaybasebin.h gstplaybin.c Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/ChangeLog.diff?r1=1.1085&r2=1.1086 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/gst/playback/gstplaybasebin.c.diff?r1=1.14&r2=1.15 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/gst/playback/gstplaybasebin.h.diff?r1=1.3&r2=1.4 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/gst/playback/gstplaybin.c.diff?r1=1.12&r2=1.13 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /cvs/gstreamer/gst-plugins/ChangeLog,v retrieving revision 1.1085 retrieving revision 1.1086 diff -u -d -r1.1085 -r1.1086 --- ChangeLog 24 Sep 2004 16:01:45 -0000 1.1085 +++ ChangeLog 24 Sep 2004 16:38:28 -0000 1.1086 @@ -1,3 +1,12 @@ +2004-09-24 Wim Taymans <wi...@fl...> + + * gst/playback/gstplaybasebin.c: (remove_prerolls), + (new_decoded_pad): + * gst/playback/gstplaybasebin.h: + * gst/playback/gstplaybin.c: (setup_sinks): + Don't try to preroll or decode more than one audio/video + track. 2004-09-24 Ronald S. Bultje <rb...@ro...> * gst/playback/gstplaybasebin.c: (gst_play_base_bin_change_state): Index: gstplaybasebin.c RCS file: /cvs/gstreamer/gst-plugins/gst/playback/gstplaybasebin.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- gstplaybasebin.c 24 Sep 2004 16:01:46 -0000 1.14 +++ gstplaybasebin.c 24 Sep 2004 16:38:28 -0000 1.15 @@ -250,6 +250,9 @@ g_list_free (play_base_bin->streaminfo); play_base_bin->streaminfo = NULL; play_base_bin->nstreams = 0; + play_base_bin->naudiopads = 0; + play_base_bin->nvideopads = 0; + play_base_bin->nunknownpads = 0; } static void @@ -285,6 +288,7 @@ GstStreamInfo *info; GstStreamType type; GstPad *srcpad; + gboolean need_preroll; GST_DEBUG ("play base: new decoded pad"); @@ -300,17 +304,31 @@ play_base_bin->nstreams++; + need_preroll = FALSE; if (g_str_has_prefix (mimetype, "audio/")) { type = GST_STREAM_TYPE_AUDIO; + play_base_bin->naudiopads++; + /* first audio pad gets a preroll element */ + if (play_base_bin->naudiopads == 1) { + need_preroll = TRUE; + } } else if (g_str_has_prefix (mimetype, "video/")) { type = GST_STREAM_TYPE_VIDEO; + play_base_bin->nvideopads++; + /* first video pad gets a preroll element */ + if (play_base_bin->nvideopads == 1) { } else { type = GST_STREAM_TYPE_UNKNOWN; + play_base_bin->nunknownpads++; } - if (last) { + if (last || !need_preroll) { srcpad = pad; - no_more_pads (NULL, play_base_bin); + if (last) + no_more_pads (NULL, play_base_bin); new_element = gen_preroll_element (play_base_bin, pad); srcpad = gst_element_get_pad (new_element, "src"); Index: gstplaybasebin.h RCS file: /cvs/gstreamer/gst-plugins/gst/playback/gstplaybasebin.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- gstplaybasebin.h 16 Jul 2004 10:45:33 -0000 1.3 +++ gstplaybasebin.h 24 Sep 2004 16:38:28 -0000 1.4 @@ -55,6 +55,10 @@ gint nstreams; GList *streaminfo; + gint naudiopads; + gint nvideopads; + gint nunknownpads; /* list of usable factories */ GList *factories; }; Index: gstplaybin.c RCS file: /cvs/gstreamer/gst-plugins/gst/playback/gstplaybin.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- gstplaybin.c 15 Sep 2004 16:48:43 -0000 1.12 +++ gstplaybin.c 24 Sep 2004 16:38:28 -0000 1.13 @@ -368,6 +368,8 @@ { GList *streaminfo; GList *s; + gboolean have_audio = FALSE; + gboolean have_video = FALSE; /* get info about the stream */ g_object_get (G_OBJECT (play_bin), "stream-info", &streaminfo, NULL); @@ -386,9 +388,21 @@ continue; if (type == 1) { - sink = gen_audio_element (play_bin); + if (have_audio) { + g_warning ("two audio streams found, playing first one"); + continue; + } else { + sink = gen_audio_element (play_bin); + have_audio = TRUE; + } } else if (type == 2) { - sink = gen_video_element (play_bin); + if (have_video) { + g_warning ("two video streams found, playing first one"); + sink = gen_video_element (play_bin); + have_video = TRUE; } else { g_warning ("unknown stream found"); |