Control: tags -1 + pending On 2013-09-17 22:46:37, Reinhard Tartler wrote: > tags 720783 +patch > > The attached patch fixes the compilation of dvswitch. > > If you agree, I'm willing to upload it, but I'd appreciate to hear > your opinion on this.
More than two weeks have passed and I've now gone ahead and uploaded the patch to DELAYED/2. Full debdiff is attached. Regards -- Sebastian Ramacher
diff -u dvswitch-0.8.3.6/debian/changelog dvswitch-0.8.3.6/debian/changelog --- dvswitch-0.8.3.6/debian/changelog +++ dvswitch-0.8.3.6/debian/changelog @@ -1,3 +1,16 @@ +dvswitch (0.8.3.6-1.2) unstable; urgency=low + + * Non-maintainer upload. + + [ Reinhard Tartler ] + * Fix compilation against libav9, closes: #720783 + + [ Sebastian Ramacher ] + * debian/control: Bump libavcodec-dev B-D to >= 6:9 since the changes to + build with libav9 are not backwards compatible. + + -- Sebastian Ramacher <sramac...@debian.org> Thu, 03 Oct 2013 19:01:13 +0200 + dvswitch (0.8.3.6-1.1) unstable; urgency=low * Non-maintainer upload. only in patch2: unchanged: --- dvswitch-0.8.3.6.orig/src/auto_codec.cpp +++ dvswitch-0.8.3.6/src/auto_codec.cpp @@ -16,7 +16,6 @@ { avcodec_initialiser() { - avcodec_init(); avcodec_register_all(); } } initialiser; @@ -24,7 +23,7 @@ auto_codec auto_codec_open_decoder(CodecID codec_id) { - auto_codec result(avcodec_alloc_context()); + auto_codec result(avcodec_alloc_context3(NULL)); if (!result.get()) throw std::bad_alloc(); auto_codec_open_decoder(result, codec_id); @@ -37,12 +36,12 @@ AVCodec * codec = avcodec_find_decoder(codec_id); if (!codec) throw os_error("avcodec_find_decoder", ENOENT); - os_check_error("avcodec_open", -avcodec_open(context.get(), codec)); + os_check_error("avcodec_open", -avcodec_open2(context.get(), codec, NULL)); } auto_codec auto_codec_open_encoder(CodecID codec_id) { - auto_codec result(avcodec_alloc_context()); + auto_codec result(avcodec_alloc_context3(NULL)); if (!result.get()) throw std::bad_alloc(); auto_codec_open_encoder(result, codec_id); @@ -55,7 +54,7 @@ AVCodec * codec = avcodec_find_encoder(codec_id); if (!codec) throw os_error("avcodec_find_encoder", ENOENT); - os_check_error("avcodec_open", -avcodec_open(context.get(), codec)); + os_check_error("avcodec_open", -avcodec_open2(context.get(), codec, NULL)); } void auto_codec_closer::operator()(AVCodecContext * context) const only in patch2: unchanged: --- dvswitch-0.8.3.6.orig/src/avcodec_wrap.h +++ dvswitch-0.8.3.6/src/avcodec_wrap.h @@ -20,6 +20,7 @@ #endif #include <avcodec.h> +#include <libavutil/mem.h> #if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(52, 26, 0) static inline int only in patch2: unchanged: --- dvswitch-0.8.3.6.orig/src/dv_display_widget.cpp +++ dvswitch-0.8.3.6/src/dv_display_widget.cpp @@ -84,7 +84,7 @@ // dv_display_widget dv_display_widget::dv_display_widget(int lowres) - : decoder_(avcodec_alloc_context()), + : decoder_(avcodec_alloc_context3(NULL)), decoded_serial_num_(-1), shm_busy_(false) { only in patch2: unchanged: --- dvswitch-0.8.3.6.orig/src/mixer.cpp +++ dvswitch-0.8.3.6/src/mixer.cpp @@ -623,7 +623,7 @@ dec->release_buffer = raw_frame_release_buffer; dec->reget_buffer = raw_frame_reget_buffer; - auto_codec encoder(avcodec_alloc_context()); + auto_codec encoder(avcodec_alloc_context3(NULL)); AVCodecContext * enc = encoder.get(); if (!enc) throw std::bad_alloc(); @@ -633,21 +633,18 @@ enc->width = 720; enc->height = 576; enc->pix_fmt = PIX_FMT_YUV420P; - auto_codec_open_encoder(encoder, CODEC_ID_DVVIDEO); { // Try to use one thread per CPU, up to a limit of 8 int enc_thread_count = std::min<int>(8, std::max<long>(sysconf(_SC_NPROCESSORS_ONLN), 1)); - if (enc_thread_count >= 2 && avcodec_thread_init(enc, enc_thread_count)) - { - std::cerr << "WARN: avcodec_thread_init(" - << enc_thread_count << ") failed\n"; - enc_thread_count = 1; - } + + enc->thread_count = enc_thread_count; std::cout << "INFO: DV encoder threads: " << enc_thread_count << "\n"; } + auto_codec_open_encoder(encoder, CODEC_ID_DVVIDEO); + for (;;) { // Get the next set of source frames and mix settings (or stop only in patch2: unchanged: --- dvswitch-0.8.3.6.orig/tests/pic_in_pic.cpp +++ dvswitch-0.8.3.6/tests/pic_in_pic.cpp @@ -268,7 +268,6 @@ int main() { - avcodec_init(); avcodec_register_all(); test_format(PIX_FMT_YUV420P); test_format(PIX_FMT_YUV411P);
signature.asc
Description: Digital signature