summaryrefslogtreecommitdiff
path: root/contrib/vdr2jpeg/ffm.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/vdr2jpeg/ffm.cpp')
-rw-r--r--contrib/vdr2jpeg/ffm.cpp34
1 files changed, 7 insertions, 27 deletions
diff --git a/contrib/vdr2jpeg/ffm.cpp b/contrib/vdr2jpeg/ffm.cpp
index 23ff23b..0d4ac28 100644
--- a/contrib/vdr2jpeg/ffm.cpp
+++ b/contrib/vdr2jpeg/ffm.cpp
@@ -19,15 +19,11 @@
#define FFMPEG_BIN "ffmpeg"
#endif
-bool decode (const char* szMPVfile, /* const tPackedList & packed, */
+bool decode (const char* szMPVfile,
const char* szTmpMask,
int width, int height)
{
- int frame_width = 0;
- int frame_height = 0;
- int keep_aspect_ratio = 1;
-
#if 0
std::cerr << "szMPVfile:" << szMPVfile << std::endl;
std::cerr << "szTmpMask:" << szTmpMask << std::endl;
@@ -35,22 +31,6 @@ bool decode (const char* szMPVfile, /* const tPackedList & packed, */
std::cerr << "height:" << height << std::endl;
#endif
- if (width > 0 || height > 0) {
- if (width > 0) {
- frame_width = width;
- keep_aspect_ratio |= 1;
- } else {
- keep_aspect_ratio &= ~1;
- }
-
- if (height > 0) {
- frame_height = height;
- keep_aspect_ratio |= 2;
- } else {
- keep_aspect_ratio &= ~2;
- }
- }
-
std::stringstream ss;
ss << FFMPEG_BIN;
@@ -62,12 +42,12 @@ bool decode (const char* szMPVfile, /* const tPackedList & packed, */
#endif
ss << " -an -i '" << szMPVfile << "'";
- if((keep_aspect_ratio & 2) == keep_aspect_ratio) { // Nur Höhe wurde definiert
- ss << " -vf scale=-1:" << frame_height;
- } else if((keep_aspect_ratio & 1) == keep_aspect_ratio) { // Nur Weite wurde definiert
- ss << " -vf scale=" << frame_width << ":-1";
- } else {
- ss << " -vf scale=" << frame_width << ":" << frame_height;
+ if(width > 0 && height > 0) {
+ ss << " -vf scale=" << width << "x" << height;
+ } else if(height > 0) { // Nur Höhe wurde definiert
+ ss << " -vf scale=-1:" << height;
+ } else if(width > 0) { // Nur Weite wurde definiert
+ ss << " -vf scale=" << width << ":-1";
}
ss << " '" << szTmpMask << "'";