]> git.sesse.net Git - nageru/blobdiff - nageru/ffmpeg_capture.cpp
On errors, abort() instead of exit(1); exit() in a multithreaded program just gives...
[nageru] / nageru / ffmpeg_capture.cpp
index b4fec063ce702a01dde9d2f7655a553fc471336c..17448c4714fbde80e33f1a4420b36bc7304791ac 100644 (file)
@@ -793,12 +793,12 @@ void FFmpegCapture::convert_audio(const AVFrame *audio_avframe, FrameAllocator::
 
                if (resampler == nullptr) {
                        fprintf(stderr, "Allocating resampler failed.\n");
-                       exit(1);
+                       abort();
                }
 
                if (swr_init(resampler) < 0) {
                        fprintf(stderr, "Could not open resample context.\n");
-                       exit(1);
+                       abort();
                }
 
                last_src_format = AVSampleFormat(audio_avframe->format);
@@ -815,7 +815,7 @@ void FFmpegCapture::convert_audio(const AVFrame *audio_avframe, FrameAllocator::
                const_cast<const uint8_t **>(audio_avframe->data), audio_avframe->nb_samples);
        if (out_samples < 0) {
                 fprintf(stderr, "Audio conversion failed.\n");
-                exit(1);
+                abort();
         }
 
        audio_frame->len += out_samples * bytes_per_sample;