Skip to content
This repository has been archived by the owner on Apr 14, 2020. It is now read-only.

Commit

Permalink
Improve code quality
Browse files Browse the repository at this point in the history
  • Loading branch information
Ullaakut committed Jun 22, 2018
1 parent c125921 commit 85465dd
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/file_input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,11 @@ gboolean bus_callback(GstBus *bus, GstMessage *msg, gpointer data) {
return TRUE;
}

inline bool file_exists (const std::string& name) {
inline bool file_exists(const std::string& name) {
struct stat buffer;

std::string corrected_name = name.substr(5);
return (stat (corrected_name.c_str(), &buffer) == 0);
return (stat(corrected_name.c_str(), &buffer) == 0);
}

bool configure_file_input(t_server *serv) {
Expand All @@ -109,11 +110,10 @@ bool configure_file_input(t_server *serv) {
g_signal_connect(serv->factory, "media-configure", (GCallback)media_configure,
app);

if (file_exists(input_path)) {
return true;
}
else {
if (!file_exists(input_path)) {
std::cerr << "Can't access " << input_path.c_str() << std::endl;
return false;
}
return false;

return true;
}

0 comments on commit 85465dd

Please sign in to comment.