Codebase list squeezelite / 1.9.9-1395+git20220104.874e4f9-1
New upstream version 1.9.9-1395+git20220104.874e4f9 No longer use deprecated ffmpeg functions tony mancill authored 2 years ago Debian Janitor committed 2 years ago
6 changed file(s) with 67 addition(s) and 78 deletion(s). Raw diff Collapse all Expand all
66 arch="all"
77 subpackages="$pkgname-doc $pkgname-dev"
88 license="Apache 2.0"
9 makedepends="git autoconf automake make tar"
9 makedepends="git autoconf automake libtool make tar"
1010 source="fix-arm-segfault.patch \
1111 alac-version.patch"
1212
0 squeezelite (1.9.9-1395+git20220104.874e4f9-1) unstable; urgency=medium
1
2 * New upstream version 1.9.9-1395+git20220104.874e4f9
3 No longer use deprecated ffmpeg functions
4
5 -- tony mancill <tmancill@debian.org> Sun, 09 Jan 2022 09:13:26 -0800
6
07 squeezelite (1.9.9-1392+git20211113.3ffdbb9-1) unstable; urgency=medium
18
29 * New upstream version 1.9.9-1392+git20211113.3ffdbb9
44
55 Files: *
66 Copyright: 2012-2015 Adrian Smith <triode1@btinternet.com>
7 2015-2021 Ralph Irving <ralph_irving@hotmail.com>
7 2015-2022 Ralph Irving <ralph_irving@hotmail.com>
88 License: GPL-3.0+
99 This program is free software: you can redistribute it and/or modify
1010 it under the terms of the GNU General Public License as published by
6464
6565 Files: debian/*
6666 Copyright: 2013-2016 Chris Boot <bootc@debian.org>
67 2020-2021 tony mancill <tmancill@debian.org>
67 2020-2022 tony mancill <tmancill@debian.org>
6868 License: GPL-2+
6969 This package is free software; you can redistribute it and/or modify
7070 it under the terms of the GNU General Public License as published by
5353 unsigned (* avcodec_version)(void);
5454 AVCodec * (* avcodec_find_decoder)(int);
5555 int attribute_align_arg (* avcodec_open2)(AVCodecContext *, const AVCodec *, AVDictionary **);
56 #if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55,28,1)
5756 AVFrame * (* av_frame_alloc)(void);
5857 void (* av_frame_free)(AVFrame **);
59 #else
60 AVFrame * (* avcodec_alloc_frame)(void);
61 void (* avcodec_free_frame)(AVFrame **);
62 #endif
63 int attribute_align_arg (* avcodec_decode_audio4)(AVCodecContext *, AVFrame *, int *, const AVPacket *);
58 int attribute_align_arg (* avcodec_send_packet)(AVCodecContext *, const AVPacket *);
59 int attribute_align_arg (* avcodec_receive_frame)(AVCodecContext *, AVFrame *);
6460 AVCodecContext * (* avcodec_alloc_context3)(const AVCodec *);
6561 void (* avcodec_free_context)(AVCodecContext **);
6662 int (* avcodec_parameters_to_context)(AVCodecContext *, const AVCodecParameters *);
7268 int (* avformat_find_stream_info)(AVFormatContext *, AVDictionary **);
7369 AVIOContext * (* avio_alloc_context)(unsigned char *, int, int, void *,
7470 int (*read_packet)(void *, uint8_t *, int), int (*write_packet)(void *, uint8_t *, int), int64_t (*seek)(void *, int64_t, int));
71 AVPacket * (* av_packet_alloc)(void);
72 #if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(58,133,100)
7573 void (* av_init_packet)(AVPacket *);
76 #if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57,24,102)
74 #endif
7775 void (* av_packet_unref)(AVPacket *);
78 #else
79 void (* av_free_packet)(AVPacket *);
80 #endif
8176 int (* av_read_frame)(AVFormatContext *, AVPacket *);
8277 AVInputFormat * (* av_find_input_format)(const char *);
78 #if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(58,9,100)
8379 void (* av_register_all)(void);
80 #endif
8481 // ffmpeg symbols to be dynamically loaded from libavutil
8582 unsigned (* avutil_version)(void);
8683 void (* av_log_set_callback)(void (*)(void*, int, const char*, va_list));
262259 }
263260
264261 static decode_state ff_decode(void) {
265 int r, len, got_frame;
266 AVPacket pkt_c;
262 int r;
267263 s32_t *optr = NULL;
268264
269265 if (decode.new_stream) {
350346
351347 AVCODEC(ff, open2, ff->codecC, codec, NULL);
352348
353 #if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55,28,1)
354349 ff->frame = AV(ff, frame_alloc);
355 #else
356 ff->frame = AVCODEC(ff, alloc_frame);
357 #endif
358
359 ff->avpkt = AV(ff, malloc, sizeof(AVPacket));
350 ff->avpkt = AV(ff, packet_alloc);
360351 if (ff->avpkt == NULL) {
361352 LOG_ERROR("can't allocate avpkt");
362353 return DECODE_ERROR;
363354 }
364355
365 AV(ff, init_packet, ff->avpkt);
366 ff->avpkt->data = NULL;
367 ff->avpkt->size = 0;
356 #if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(58,133,100)
357 AV(ff, init_packet, ff->avpkt); // on older ffmpeg, this still is needed to e.g. set ->pos to -1
358 #endif
368359
369360 LOCK_O;
370361 LOG_INFO("setting track_start");
375366 decode.new_stream = false;
376367 UNLOCK_O;
377368 }
378
379 got_frame = 0;
380369
381370 if ((r = AV(ff, read_frame, ff->formatC, ff->avpkt)) < 0) {
382371 if (r == AVERROR_EOF) {
392381 return DECODE_RUNNING;
393382 }
394383
395 // clone packet as we are adjusting it
396 pkt_c = *ff->avpkt;
397
398384 IF_PROCESS(
399385 optr = (s32_t *)process.inbuf;
400386 process.in_frames = 0;
401387 );
402388
403 while (pkt_c.size > 0 || got_frame) {
404
405 len = AVCODEC(ff, decode_audio4, ff->codecC, ff->frame, &got_frame, &pkt_c);
406 if (len < 0) {
407 LOG_ERROR("avcodec_decode_audio4 error: %i %s", len, av__err2str(len));
408 break; // exit loop, free the packet, and continue decoding
409 }
410
411 pkt_c.data += len;
412 pkt_c.size -= len;
413
414 if (got_frame) {
415
389 if ((r = AVCODEC(ff, send_packet, ff->codecC, ff->avpkt)) < 0) {
390 AV(ff, packet_unref, ff->avpkt);
391
392 if (r == AVERROR_EOF) {
393 LOG_DEBUG("av_send_packet reports eof");
394 return DECODE_COMPLETE;
395 } else {
396 LOG_ERROR("av_send_packet error: %i %s", r, av__err2str(r));
397
398 // EAGAIN is treated as an unrecoverable error here since all pending output frames are processed below
399 if (r == AVERROR(EAGAIN) || r == AVERROR(EINVAL) || r == AVERROR(ENOMEM))
400 return DECODE_ERROR;
401
402 // retain existing behavior (continue decoding) for legitimate decoding errors
403 return DECODE_RUNNING;
404 }
405 } else {
406 // a single input packet can lead to multiple output frames - process all of them
407 while ((r = AVCODEC(ff, receive_frame, ff->codecC, ff->frame)) >= 0) {
416408 s16_t *iptr16 = (s16_t *)ff->frame->data[0];
417409 s32_t *iptr32 = (s32_t *)ff->frame->data[0];
418410 s16_t *iptr16l = (s16_t *)ff->frame->data[0];
535527 }
536528 }
537529
538 #if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57,24,102)
539530 AV(ff, packet_unref, ff->avpkt);
540 #else
541 AV(ff, free_packet, ff->avpkt);
542 #endif
531
532 if (r == AVERROR(EAGAIN)) {
533 // EAGAIN is expected if there are no more pending frames
534 } else if (r == AVERROR_EOF) {
535 LOG_DEBUG("av_receive_frame reports eof");
536 return DECODE_COMPLETE;
537 } else {
538 LOG_ERROR("av_receive_frame error: %i %s", r, av__err2str(r));
539
540 if (r == AVERROR(EINVAL))
541 return DECODE_ERROR;
542
543 // retain existing behavior (continue decoding) for legitimate decoding errors
544 }
543545
544546 return DECODE_RUNNING;
545547 }
564566 }
565567
566568 if (ff->frame) {
567 // ffmpeg version dependant free function
568 #if !LINKALL
569 #if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55,28,1)
570 ff->av_frame_free ? AV(ff, frame_free, &ff->frame) : AV(ff, freep, &ff->frame);
571 #else
572 ff->avcodec_free_frame ? AVCODEC(ff, free_frame, &ff->frame) : AV(ff, freep, &ff->frame);
573 #endif
574 #elif LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(54,28,0)
575 #if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55,28,1)
576569 AV(ff, frame_free, &ff->frame);
577 #else
578 AVCODEC(ff, free_frame, &ff->frame);
579 #endif
580 #else
581 AV(ff, freep, &ff->frame);
582 #endif
583570 ff->frame = NULL;
584571 }
585572
586573 if (ff->avpkt) {
587 #if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57,24,102)
588574 AV(ff, packet_unref, ff->avpkt);
589 #else
590 AV(ff, free_packet, ff->avpkt);
591 #endif
592575 AV(ff, freep, &ff->avpkt);
593576 ff->avpkt = NULL;
594577 }
660643 ff->avcodec_version = dlsym(handle_codec, "avcodec_version");
661644 ff->avcodec_find_decoder = dlsym(handle_codec, "avcodec_find_decoder");
662645 ff->avcodec_open2 = dlsym(handle_codec, "avcodec_open2");
663 #if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55,28,1)
664646 ff->av_frame_alloc = dlsym(handle_codec, "av_frame_alloc");
665647 ff->av_frame_free = dlsym(handle_codec, "av_frame_free");
666 #else
667 ff->avcodec_alloc_frame = dlsym(handle_codec, "avcodec_alloc_frame");
668 ff->avcodec_free_frame = dlsym(handle_codec, "avcodec_free_frame");
669 #endif
670 ff->avcodec_decode_audio4 = dlsym(handle_codec, "avcodec_decode_audio4");
648 ff->avcodec_send_packet = dlsym(handle_codec, "avcodec_send_packet");
649 ff->avcodec_receive_frame = dlsym(handle_codec, "avcodec_receive_frame");
671650 ff->avcodec_alloc_context3 = dlsym(handle_format, "avcodec_alloc_context3");
672651 ff->avcodec_free_context = dlsym(handle_format, "avcodec_free_context");
673652 ff->avcodec_parameters_to_context = dlsym(handle_format, "avcodec_parameters_to_context");
653 ff->av_packet_alloc = dlsym(handle_codec, "av_packet_alloc");
654 #if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(58,133,100)
674655 ff->av_init_packet = dlsym(handle_codec, "av_init_packet");
675 #if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57,24,102)
656 #endif
676657 ff->av_packet_unref = dlsym(handle_codec, "av_packet_unref");
677 #else
678 ff->av_free_packet = dlsym(handle_codec, "av_free_packet");
679 #endif
680658
681659 if ((err = dlerror()) != NULL) {
682660 LOG_INFO("dlerror: %s", err);
693671 ff->avio_alloc_context = dlsym(handle_format, "avio_alloc_context");
694672 ff->av_read_frame = dlsym(handle_format, "av_read_frame");
695673 ff->av_find_input_format= dlsym(handle_format, "av_find_input_format");
674 #if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(58,9,100)
696675 ff->av_register_all = dlsym(handle_format, "av_register_all");
676 #endif
697677
698678 if ((err = dlerror()) != NULL) {
699679 LOG_INFO("dlerror: %s", err);
760740
761741 AV(ff, log_set_callback, av_err_callback);
762742
743 #if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(58,9,100)
763744 AV(ff, register_all);
764
745 #endif
746
765747 registered = true;
766748 }
767749
2525
2626 #define MAJOR_VERSION "1.9"
2727 #define MINOR_VERSION "9"
28 #define MICRO_VERSION "1392"
28 #define MICRO_VERSION "1395"
2929
3030 #if defined(CUSTOM_VERSION)
3131 #define VERSION "v" MAJOR_VERSION "." MINOR_VERSION "-" MICRO_VERSION STR(CUSTOM_VERSION)
129129 <Tool
130130 Name="VCLinkerTool"
131131 AdditionalOptions="/NODEFAULTLIB:LIBCMT"
132 AdditionalDependencies="ws2_32.lib lib\portaudio.lib lib\libogg.lib lib\libvorbisfile.lib lib\libvorbis.lib lib\libmad.lib lib\libFLAC.lib lib\libfaad.lib lib\libmpg123.lib lib\libsoxr.lib lib\libavformat.a lib\libavcodec.a lib\libavutil.a lib\ssleay32.lib lib\libeay32.lib lib\opus.lib lib\opusfile.lib"
132 AdditionalDependencies="ws2_32.lib crypt32.lib lib\portaudio.lib lib\libogg.lib lib\libvorbisfile.lib lib\libvorbis.lib lib\libmad.lib lib\libFLAC.lib lib\libfaad.lib lib\libmpg123.lib lib\libsoxr.lib lib\libavformat.a lib\libavcodec.a lib\libavutil.a lib\ssleay32.lib lib\libeay32.lib lib\opus.lib lib\opusfile.lib"
133133 OutputFile="$(OutDir)\$(ProjectName)-ffmpeg.exe"
134134 LinkIncremental="1"
135135 ModuleDefinitionFile=""