]> git.sesse.net Git - nageru/commitdiff
Fix an embarrassing messup with the new ResamplingQueue formats.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 8 May 2016 17:24:19 +0000 (19:24 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Mon, 9 May 2016 08:40:22 +0000 (10:40 +0200)
mixer.cpp
resampling_queue.cpp

index 1d71ac897bf3bceeb9966eb6c85678decc03bf83..19cb8bee202dacc708ea9430f4b98a3fa7969807 100644 (file)
--- a/mixer.cpp
+++ b/mixer.cpp
@@ -290,7 +290,7 @@ void Mixer::configure_card(unsigned card_index, const QSurfaceFormat &format, Ca
        card->frame_allocator.reset(new PBOFrameAllocator(8 << 20, WIDTH, HEIGHT));  // 8 MB.
        card->capture->set_video_frame_allocator(card->frame_allocator.get());
        card->surface = create_surface(format);
-       card->resampling_queue.reset(new ResamplingQueue(OUTPUT_FREQUENCY, OUTPUT_FREQUENCY, 2));
+       card->resampling_queue.reset(new ResamplingQueue(card_index, OUTPUT_FREQUENCY, OUTPUT_FREQUENCY, 2));
        card->capture->configure_card();
 }
 
@@ -410,7 +410,7 @@ void Mixer::bm_frame(unsigned card_index, uint16_t timecode,
                if (dropped_frames > MAX_FPS * 2) {
                        fprintf(stderr, "Card %d lost more than two seconds (or time code jumping around; from 0x%04x to 0x%04x), resetting resampler\n",
                                card_index, card->last_timecode, timecode);
-                       card->resampling_queue.reset(new ResamplingQueue(OUTPUT_FREQUENCY, OUTPUT_FREQUENCY, 2));
+                       card->resampling_queue.reset(new ResamplingQueue(card_index, OUTPUT_FREQUENCY, OUTPUT_FREQUENCY, 2));
                        dropped_frames = 0;
                } else if (dropped_frames > 0) {
                        // Insert silence as needed.
index dec8599661e8658d6730d4be4b2946df46807fa9..62c4413792b2cdba4be07119d692173dc0fb7b7f 100644 (file)
@@ -147,7 +147,8 @@ bool ResamplingQueue::get_output_samples(double pts, float *samples, ssize_t num
                vresampler.inp_count = num_input_samples;
                vresampler.inp_data = inbuf;
 
-               vresampler.process();
+               int err = vresampler.process();
+               assert(err == 0);
 
                size_t consumed_samples = num_input_samples - vresampler.inp_count;
                total_consumed_samples += consumed_samples;