+static void throw_on_ffmpeg_error(int ret, const char* source, const char* func, const char* local_func, const char* file, int line)\r
+{\r
+ if(ret >= 0)\r
+ return;\r
+\r
+ switch(ret)\r
+ {\r
+ case AVERROR_BSF_NOT_FOUND:\r
+ ::boost::exception_detail::throw_exception_(averror_bsf_not_found()<< \r
+ msg_info(av_error_str(ret)) << \r
+ source_info(narrow(source)) << \r
+ boost::errinfo_api_function(func) << \r
+ boost::errinfo_errno(AVUNERROR(ret)), local_func, file, line); \r
+ case AVERROR_DECODER_NOT_FOUND:\r
+ ::boost::exception_detail::throw_exception_(averror_decoder_not_found()<< \r
+ msg_info(av_error_str(ret)) << \r
+ source_info(narrow(source)) << \r
+ boost::errinfo_api_function(func) << \r
+ boost::errinfo_errno(AVUNERROR(ret)), local_func, file, line);\r
+ case AVERROR_DEMUXER_NOT_FOUND:\r
+ ::boost::exception_detail::throw_exception_(averror_demuxer_not_found()<< \r
+ msg_info(av_error_str(ret)) << \r
+ source_info(narrow(source)) << \r
+ boost::errinfo_api_function(func) << \r
+ boost::errinfo_errno(AVUNERROR(ret)), local_func, file, line);\r
+ case AVERROR_ENCODER_NOT_FOUND:\r
+ ::boost::exception_detail::throw_exception_(averror_encoder_not_found()<< \r
+ msg_info(av_error_str(ret)) << \r
+ source_info(narrow(source)) << \r
+ boost::errinfo_api_function(func) << \r
+ boost::errinfo_errno(AVUNERROR(ret)), local_func, file, line); \r
+ case AVERROR_EOF: \r
+ ::boost::exception_detail::throw_exception_(averror_eof()<< \r
+ msg_info(av_error_str(ret)) << \r
+ source_info(narrow(source)) << \r
+ boost::errinfo_api_function(func) << \r
+ boost::errinfo_errno(AVUNERROR(ret)), local_func, file, line);\r
+ case AVERROR_EXIT: \r
+ ::boost::exception_detail::throw_exception_(averror_exit()<< \r
+ msg_info(av_error_str(ret)) << \r
+ source_info(narrow(source)) << \r
+ boost::errinfo_api_function(func) << \r
+ boost::errinfo_errno(AVUNERROR(ret)), local_func, file, line);\r
+ case AVERROR_FILTER_NOT_FOUND: \r
+ ::boost::exception_detail::throw_exception_(averror_filter_not_found()<< \r
+ msg_info(av_error_str(ret)) << \r
+ source_info(narrow(source)) << \r
+ boost::errinfo_api_function(func) << \r
+ boost::errinfo_errno(AVUNERROR(ret)), local_func, file, line);\r
+ case AVERROR_MUXER_NOT_FOUND: \r
+ ::boost::exception_detail::throw_exception_(averror_muxer_not_found()<< \r
+ msg_info(av_error_str(ret)) << \r
+ source_info(narrow(source)) << \r
+ boost::errinfo_api_function(func) << \r
+ boost::errinfo_errno(AVUNERROR(ret)), local_func, file, line);\r
+ case AVERROR_OPTION_NOT_FOUND: \r
+ ::boost::exception_detail::throw_exception_(averror_option_not_found()<< \r
+ msg_info(av_error_str(ret)) << \r
+ source_info(narrow(source)) << \r
+ boost::errinfo_api_function(func) << \r
+ boost::errinfo_errno(AVUNERROR(ret)), local_func, file, line);\r
+ case AVERROR_PATCHWELCOME: \r
+ ::boost::exception_detail::throw_exception_(averror_patchwelcome()<< \r
+ msg_info(av_error_str(ret)) << \r
+ source_info(narrow(source)) << \r
+ boost::errinfo_api_function(func) << \r
+ boost::errinfo_errno(AVUNERROR(ret)), local_func, file, line);\r
+ case AVERROR_PROTOCOL_NOT_FOUND: \r
+ ::boost::exception_detail::throw_exception_(averror_protocol_not_found()<< \r
+ msg_info(av_error_str(ret)) << \r
+ source_info(narrow(source)) << \r
+ boost::errinfo_api_function(func) << \r
+ boost::errinfo_errno(AVUNERROR(ret)), local_func, file, line);\r
+ case AVERROR_STREAM_NOT_FOUND:\r
+ ::boost::exception_detail::throw_exception_(averror_stream_not_found()<< \r
+ msg_info(av_error_str(ret)) << \r
+ source_info(narrow(source)) << \r
+ boost::errinfo_api_function(func) << \r
+ boost::errinfo_errno(AVUNERROR(ret)), local_func, file, line);\r
+ default:\r
+ ::boost::exception_detail::throw_exception_(ffmpeg_error()<< \r
+ msg_info(av_error_str(ret)) << \r
+ source_info(narrow(source)) << \r
+ boost::errinfo_api_function(func) << \r
+ boost::errinfo_errno(AVUNERROR(ret)), local_func, file, line);\r