forked from raullalves/player-cpp-ffmpeg-sdl
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
42 lines (31 loc) · 732 Bytes
/
Copy pathmain.cpp
File metadata and controls
42 lines (31 loc) · 732 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#include "Player.hpp"
#ifdef main
#undef main
#endif
using namespace std;
int main(int argc, const char *argv[]) {
if(argc != 2){
cout << "Usage: ./player video_addr"<<endl;
exit(-1);
}
if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_TIMER)) {
cout << "There is something wrong with your SDL Libs. Can't run" << endl;
exit(-1);
}
Player * player = new Player(argv[1]);
int res = player->AllocateMemory();
if (res < 0) {
cout << "Fatal Error";
delete(player);
exit(-1);
}
res= player->CreateDisplay();
res = player->lerFramesVideo();
if (res < 0) {
cout << "Shit happens" << endl;
delete(player);
exit(-1);
}
delete(player);
return 0;
}