summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/libdv_wrapper.cc12
-rw-r--r--lib/libdv_wrapper.h1
2 files changed, 8 insertions, 5 deletions
diff --git a/lib/libdv_wrapper.cc b/lib/libdv_wrapper.cc
index d570e2c..563c709 100644
--- a/lib/libdv_wrapper.cc
+++ b/lib/libdv_wrapper.cc
@@ -26,7 +26,7 @@
*/
#include "libdv_wrapper.h"
-static bool first = true;
+//#define COLORSPACE_YV12
LibDVWrapper::LibDVWrapper(DV::Quality quality,
DV::System system,
@@ -39,8 +39,11 @@ LibDVWrapper::LibDVWrapper(DV::Quality quality,
setSystem(system);
setSampling(sampling);
+ yuv[0] = yuv[1] = yuv[2] = NULL;
+
width = 720;
height = 576;
+ first = true;
}
@@ -74,19 +77,18 @@ void LibDVWrapper::setOutputBuffer(char *output)
pitches[1] = width / 2;
pitches[2] = width / 2;
#else
- yuv[0] = (unsigned char*)output;//render.getDisplayData(); // Decode directly to the XVideo buffer
+ yuv[0] = (unsigned char*)output;
pitches[0] = width * 2;
#endif
}
void LibDVWrapper::decode(char *input)
{
+ if(!yuv[0]) return; // outputbuffer not set!
+
if(first) {
dv_parse_header(decoder, (const uint8_t*)input);
//dv_parse_packs(decoder, frame->data); // Not needed anyway!
-
- // decoder->system = e_dv_system_625_50; // PAL lines, PAL framerate
- // decoder->sampling = e_dv_sample_422; // 4 bytes y, 2 bytes u, 2 bytes v
decoder->std = e_dv_std_iec_61834;
decoder->num_dif_seqs = 12;
first = false;
diff --git a/lib/libdv_wrapper.h b/lib/libdv_wrapper.h
index 995e8d7..d98cae6 100644
--- a/lib/libdv_wrapper.h
+++ b/lib/libdv_wrapper.h
@@ -96,6 +96,7 @@ public:
void decode(char *input);
private:
+ bool first;
int width, height;
int pitches[3];