Merge master.
[dcpomatic.git] / src / lib / ffmpeg_decoder.cc
index dc2a5590b450f2226ef55ef0ffab005022aa899c..32b00a1d640e321a1d464cd151ddacc7ce6ed636 100644 (file)
@@ -182,6 +182,23 @@ FFmpegDecoder::deinterleave_audio (uint8_t** data, int size)
        shared_ptr<AudioBuffers> audio (new AudioBuffers (_ffmpeg_content->audio_channels(), frames));
 
        switch (audio_sample_format()) {
+       case AV_SAMPLE_FMT_U8:
+       {
+               uint8_t* p = reinterpret_cast<uint8_t *> (data[0]);
+               int sample = 0;
+               int channel = 0;
+               for (int i = 0; i < total_samples; ++i) {
+                       audio->data(channel)[sample] = float(*p++) / (1 << 23);
+
+                       ++channel;
+                       if (channel == _ffmpeg_content->audio_channels()) {
+                               channel = 0;
+                               ++sample;
+                       }
+               }
+       }
+       break;
+       
        case AV_SAMPLE_FMT_S16:
        {
                int16_t* p = reinterpret_cast<int16_t *> (data[0]);
@@ -470,14 +487,9 @@ FFmpegDecoder::decode_video_packet ()
 
        list<pair<shared_ptr<Image>, int64_t> > images = graph->process (_frame);
 
-       string post_process = Filter::ffmpeg_strings (_ffmpeg_content->filters()).second;
-       
        for (list<pair<shared_ptr<Image>, int64_t> >::iterator i = images.begin(); i != images.end(); ++i) {
 
                shared_ptr<Image> image = i->first;
-               if (!post_process.empty ()) {
-                       image = image->post_process (post_process, true);
-               }
                
                if (i->second != AV_NOPTS_VALUE) {
                        video (image, false, ContentTime::from_seconds (i->second * av_q2d (_format_context->streams[_video_stream]->time_base)) + _pts_offset);