2006-02-07 Tim-Philipp Müller <tim at centricular dot net>
+ * gst/playback/gstplaybasebin.c: (prepare_output):
+ Error out if we have only text or subtitles, but nothing
+ else. Also error out if we have subtitles but no video
+ stream.
+
+2006-02-07 Tim-Philipp Müller <tim at centricular dot net>
+
* ext/gnomevfs/gstgnomevfssrc.c: (gst_gnome_vfs_src_create):
Treat GNOME_VFS_RESULT_EOF as EOS, not as error (#329194).
Post an error message on the bus when we encounter an
{
const GList *item;
gboolean stream_found = FALSE, no_media = FALSE;
+ gboolean got_video = FALSE, got_subtitle = FALSE;;
GstPlayBaseGroup *group;
group = get_active_group (play_base_bin);
for (item = group ? group->streaminfo : NULL; item != NULL; item = item->next) {
GstStreamInfo *info = GST_STREAM_INFO (item->data);
- if (info->type != GST_STREAM_TYPE_UNKNOWN) {
+ if (info->type == GST_STREAM_TYPE_VIDEO) {
stream_found = TRUE;
+ got_video = TRUE;
break;
+ } else if (info->type == GST_STREAM_TYPE_AUDIO) {
+ stream_found = TRUE;
+ } else if (info->type == GST_STREAM_TYPE_TEXT) {
+ got_subtitle = TRUE;
} else if (!item->prev && !item->next) {
/* We're no audio/video and the only stream... We could
* be something not-media that's detected because then our
}
if (!stream_found) {
- if (!no_media) {
+ if (got_subtitle) {
+ GST_ELEMENT_ERROR (play_base_bin, STREAM, WRONG_TYPE,
+ (_("Only a subtitle stream was detected. "
+ "Either you are loading a subtitle file or some other type of "
+ "text file, or the media file was not recognized.")), (NULL));
+ } else if (!no_media) {
GST_ELEMENT_ERROR (play_base_bin, STREAM, CODEC_NOT_FOUND,
(_("You do not have a decoder installed to handle \"%s\". You might need to install the necessary plugins."), play_base_bin->uri), (NULL));
} else {
(_("\"%s\" is not a media file"), play_base_bin->uri), (NULL));
}
return FALSE;
+ } else if (got_subtitle && !got_video) {
+ GST_ELEMENT_ERROR (play_base_bin, STREAM, WRONG_TYPE,
+ (_("A subtitle stream was detected, but no video stream.")), (NULL));
+ return FALSE;
}
return TRUE;