private void HandleError (Enum domain, string error_message, string debug)
{
Close (true);
error_message = error_message ?? Catalog.GetString ("Unknown Error");
if (domain is ResourceError) {
ResourceError domain_code = (ResourceError)domain;
if (CurrentTrack != null) {
switch (domain_code) {
case ResourceError.NotFound:
CurrentTrack.SavePlaybackError (StreamPlaybackError.ResourceNotFound);
break;
default:
break;
}
}
Log.Error (String.Format ("GStreamer resource error: {0}", domain_code), false);
} else if (domain is StreamError) {
StreamError domain_code = (StreamError)domain;
if (CurrentTrack != null) {
switch (domain_code) {
case StreamError.CodecNotFound:
CurrentTrack.SavePlaybackError (StreamPlaybackError.CodecNotFound);
break;
default:
break;
}
}
Log.Error (String.Format ("GStreamer stream error: {0}", domain_code), false);
} else if (domain is CoreError) {
CoreError domain_code = (CoreError)domain;
if (CurrentTrack != null) {
switch (domain_code) {
case CoreError.MissingPlugin:
CurrentTrack.SavePlaybackError (StreamPlaybackError.CodecNotFound);
break;
default:
break;
}
}
if (domain_code != CoreError.MissingPlugin) {
Log.Error (String.Format ("GStreamer core error: {0}", (CoreError)domain), false);
}
} else if (domain is LibraryError) {
Log.Error (String.Format ("GStreamer library error: {0}", (LibraryError)domain), false);
}
OnEventChanged (new PlayerEventErrorArgs (error_message));
}