multimedia/miro: unbreak with ffmpeg 4.0

linux/miro-segmenter.c:103:48: error: use of undeclared identifier 'CODEC_FLAG_GLOBAL_HEADER'
                output_codec_context->flags |= CODEC_FLAG_GLOBAL_HEADER;
                                               ^
linux/miro-segmenter.c:270:46: error: no member named 'pts' in 'struct AVStream'
            segment_time = (double)video_st->pts.val * video_st->time_base.num / video_st->time_base.den;
                                   ~~~~~~~~  ^
linux/miro-segmenter.c:273:46: error: no member named 'pts' in 'struct AVStream'
            segment_time = (double)audio_st->pts.val * audio_st->time_base.num / audio_st->time_base.den;
                                   ~~~~~~~~  ^

PR:		227726
Reported by:	antoine (via exp-run)
This commit is contained in:
Jan Beich 2018-05-04 11:40:30 +00:00
parent 1bad291d8b
commit b312b19581
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=469017
2 changed files with 31 additions and 2 deletions

View file

@ -13,8 +13,6 @@ COMMENT= Video player to get internet TV broadcasts
LICENSE= GPLv2 LICENSE= GPLv2
BROKEN= fails to build with ffmpeg 4.0
BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}pyrex>0:devel/pyrex@${FLAVOR} \ BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}pyrex>0:devel/pyrex@${FLAVOR} \
${PYTHON_SITELIBDIR}/webkit/__init__.py:www/py-webkitgtk@${FLAVOR} \ ${PYTHON_SITELIBDIR}/webkit/__init__.py:www/py-webkitgtk@${FLAVOR} \
update-mime-database:misc/shared-mime-info \ update-mime-database:misc/shared-mime-info \

View file

@ -23,3 +23,34 @@
output_codec_context->block_align = 0; output_codec_context->block_align = 0;
} }
else { else {
@@ -92,7 +100,11 @@ static AVStream *add_output_stream(AVFormatContext *ou
output_codec_context->has_b_frames = input_codec_context->has_b_frames;
if (output_format_context->oformat->flags & AVFMT_GLOBALHEADER) {
+#if LIBAVCODEC_VERSION_MAJOR > 57
+ output_codec_context->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
+#else
output_codec_context->flags |= CODEC_FLAG_GLOBAL_HEADER;
+#endif
}
break;
default:
@@ -259,10 +271,18 @@ int main(int argc, char **argv)
#else
if (packet.stream_index == video_index && (packet.flags & PKT_FLAG_KEY)) {
#endif
+#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(55,40,100)
+ segment_time = (double)av_stream_get_end_pts(video_st) * video_st->time_base.num / video_st->time_base.den;
+#else
segment_time = (double)video_st->pts.val * video_st->time_base.num / video_st->time_base.den;
+#endif
}
else if (video_index < 0) {
+#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(55,40,100)
+ segment_time = (double)av_stream_get_end_pts(audio_st) * audio_st->time_base.num / audio_st->time_base.den;
+#else
segment_time = (double)audio_st->pts.val * audio_st->time_base.num / audio_st->time_base.den;
+#endif
}
else {
segment_time = prev_segment_time;