@@ -205,7 +205,7 @@ int VideoPicture::set_dimensions(int w, int h) {
205
205
std::unique_ptr<AVFrame, VideoPicture::AVFrameDeleter> frame{
206
206
av_frame_alloc ()};
207
207
if (frame == nullptr ) {
208
- std::cerr << " av_frame_alloc failed" << std::endl;
208
+ OSG_FATAL << " av_frame_alloc failed" << std::endl;
209
209
return -1 ;
210
210
}
211
211
@@ -215,7 +215,7 @@ int VideoPicture::set_dimensions(int w, int h) {
215
215
frame->height = h;
216
216
if (av_image_alloc (frame->data , frame->linesize , frame->width , frame->height ,
217
217
kPixFmt , 1 ) < 0 ) {
218
- std::cerr << " av_image_alloc failed" << std::endl;
218
+ OSG_FATAL << " av_image_alloc failed" << std::endl;
219
219
return -1 ;
220
220
}
221
221
@@ -442,7 +442,7 @@ class VideoThread
442
442
}
443
443
catch (std::exception & e)
444
444
{
445
- std::cerr << " An error occurred playing the video: " << e.what () << std::endl;
445
+ OSG_FATAL << " An error occurred playing the video: " << e.what () << std::endl;
446
446
}
447
447
})
448
448
{
@@ -567,9 +567,9 @@ class ParseThread
567
567
{
568
568
// In the FFMpeg 4.0 a "filename" field was replaced by "url"
569
569
#if LIBAVCODEC_VERSION_INT < 3805796
570
- std::cerr << " Error seeking " << self->format_ctx ->filename << std::endl;
570
+ OSG_FATAL << " Error seeking " << self->format_ctx ->filename << std::endl;
571
571
#else
572
- std::cerr << " Error seeking " << self->format_ctx ->url << std::endl;
572
+ OSG_FATAL << " Error seeking " << self->format_ctx ->url << std::endl;
573
573
#endif
574
574
}
575
575
else
@@ -635,7 +635,7 @@ class ParseThread
635
635
}
636
636
}
637
637
catch (std::exception & e) {
638
- std::cerr << " An error occurred playing the video: " << e.what () << std::endl;
638
+ OSG_FATAL << " An error occurred playing the video: " << e.what () << std::endl;
639
639
}
640
640
641
641
self->mQuit = true ;
@@ -689,7 +689,7 @@ int VideoState::stream_open(int stream_index, AVFormatContext *pFormatCtx)
689
689
690
690
if (!mAudioFactory )
691
691
{
692
- std::cerr << " No audio factory registered, can not play audio stream" << std::endl;
692
+ OSG_FATAL << " No audio factory registered, can not play audio stream" << std::endl;
693
693
avcodec_free_context (&this ->audio_ctx );
694
694
this ->audio_st = nullptr ;
695
695
return -1 ;
@@ -698,7 +698,7 @@ int VideoState::stream_open(int stream_index, AVFormatContext *pFormatCtx)
698
698
mAudioDecoder = mAudioFactory ->createDecoder (this );
699
699
if (!mAudioDecoder )
700
700
{
701
- std::cerr << " Failed to create audio decoder, can not play audio stream" << std::endl;
701
+ OSG_FATAL << " Failed to create audio decoder, can not play audio stream" << std::endl;
702
702
avcodec_free_context (&this ->audio_ctx );
703
703
this ->audio_st = nullptr ;
704
704
return -1 ;
0 commit comments