Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
9d91aa23
Commit
9d91aa23
authored
Mar 31, 2011
by
Anton Khirnov
Committed by
Max Kellermann
Apr 12, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder/ffmpeg: drop support for pre-0.5 ffmpeg
All modern distros ship 0.5, so there's no need to support old and buggy ffmpeg versions.
parent
c2ada39f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
2 additions
and
65 deletions
+2
-65
NEWS
NEWS
+1
-0
configure.ac
configure.ac
+1
-12
ffmpeg_decoder_plugin.c
src/decoder/ffmpeg_decoder_plugin.c
+0
-46
ffmpeg_input_plugin.c
src/input/ffmpeg_input_plugin.c
+0
-7
No files found.
NEWS
View file @
9d91aa23
...
...
@@ -7,6 +7,7 @@ ver 0.17 (2011/??/??)
- curl: enable CURLOPT_NETRC
* decoder:
- mpg123: implement seeking
- ffmpeg: drop support for pre-0.5 ffmpeg
* output:
- osx: allow user to specify other audio devices
- raop: new output plugin
...
...
configure.ac
View file @
9d91aa23
...
...
@@ -771,21 +771,10 @@ AM_CONDITIONAL(HAVE_FAAD, test x$enable_aac = xyes)
AM_CONDITIONAL(HAVE_MP4, test x$enable_mp4 = xyes)
dnl ---------------------------------- ffmpeg ---------------------------------
MPD_AUTO_PKG(ffmpeg, FFMPEG, [libavformat >= 52
libavcodec >= 51 libavutil >= 49
],
MPD_AUTO_PKG(ffmpeg, FFMPEG, [libavformat >= 52
.31 libavcodec >= 52.20 libavutil >= 49.15
],
[ffmpeg decoder library], [libavformat+libavcodec+libavutil not found])
if test x$enable_ffmpeg = xyes; then
# prior to ffmpeg svn12865, you had to specify include files
# without path prefix
old_CPPCFLAGS=$CPPFLAGS
CPPFLAGS="$CPPFLAGS $FFMPEG_CFLAGS"
AC_CHECK_HEADER(libavcodec/avcodec.h,,
AC_DEFINE(OLD_FFMPEG_INCLUDES, 1,
[Define if avcodec.h instead of libavcodec/avcodec.h should be included]))
CPPCFLAGS=$old_CPPFLAGS
fi
if test x$enable_ffmpeg = xyes; then
AC_DEFINE(HAVE_FFMPEG, 1, [Define for FFMPEG support])
fi
...
...
src/decoder/ffmpeg_decoder_plugin.c
View file @
9d91aa23
...
...
@@ -32,22 +32,14 @@
#include <sys/stat.h>
#include <unistd.h>
#ifdef OLD_FFMPEG_INCLUDES
#include <avcodec.h>
#include <avformat.h>
#include <avio.h>
#else
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
#include <libavformat/avio.h>
#include <libavutil/log.h>
#endif
#undef G_LOG_DOMAIN
#define G_LOG_DOMAIN "ffmpeg"
#ifndef OLD_FFMPEG_INCLUDES
static
GLogLevelFlags
level_ffmpeg_to_glib
(
int
level
)
{
...
...
@@ -79,8 +71,6 @@ mpd_ffmpeg_log_callback(G_GNUC_UNUSED void *ptr, int level,
}
}
#endif
/* !OLD_FFMPEG_INCLUDES */
struct
mpd_ffmpeg_stream
{
struct
decoder
*
decoder
;
struct
input_stream
*
input
;
...
...
@@ -143,9 +133,7 @@ mpd_ffmpeg_stream_close(struct mpd_ffmpeg_stream *stream)
static
bool
ffmpeg_init
(
G_GNUC_UNUSED
const
struct
config_param
*
param
)
{
#ifndef OLD_FFMPEG_INCLUDES
av_log_set_callback
(
mpd_ffmpeg_log_callback
);
#endif
av_register_all
();
return
true
;
...
...
@@ -230,7 +218,6 @@ ffmpeg_send_packet(struct decoder *decoder, struct input_stream *is,
static
enum
sample_format
ffmpeg_sample_format
(
G_GNUC_UNUSED
const
AVCodecContext
*
codec_context
)
{
#if LIBAVCODEC_VERSION_INT >= ((51<<16)+(41<<8)+0)
switch
(
codec_context
->
sample_fmt
)
{
case
SAMPLE_FMT_S16
:
return
SAMPLE_FORMAT_S16
;
...
...
@@ -243,10 +230,6 @@ ffmpeg_sample_format(G_GNUC_UNUSED const AVCodecContext *codec_context)
codec_context
->
sample_fmt
);
return
SAMPLE_FORMAT_UNDEFINED
;
}
#else
/* XXX fixme 16-bit for older ffmpeg (13 Aug 2007) */
return
SAMPLE_FORMAT_S16
;
#endif
}
static
AVInputFormat
*
...
...
@@ -400,7 +383,6 @@ ffmpeg_decode(struct decoder *decoder, struct input_stream *input)
mpd_ffmpeg_stream_close
(
stream
);
}
#if LIBAVFORMAT_VERSION_INT >= ((52<<16)+(31<<8)+0)
typedef
struct
ffmpeg_tag_map
{
enum
tag_type
type
;
const
char
*
name
;
...
...
@@ -438,8 +420,6 @@ ffmpeg_copy_metadata(struct tag *tag, AVMetadata *m,
return
mt
!=
NULL
;
}
#endif
//no tag reading in ffmpeg, check if playable
static
struct
tag
*
ffmpeg_stream_tag
(
struct
input_stream
*
is
)
...
...
@@ -471,7 +451,6 @@ ffmpeg_stream_tag(struct input_stream *is)
?
f
->
duration
/
AV_TIME_BASE
:
0
;
#if LIBAVFORMAT_VERSION_INT >= ((52<<16)+(31<<8)+0)
av_metadata_conv
(
f
,
NULL
,
f
->
iformat
->
metadata_conv
);
for
(
unsigned
i
=
0
;
i
<
sizeof
(
ffmpeg_tag_maps
)
/
sizeof
(
ffmpeg_tag_map
);
i
++
)
{
...
...
@@ -480,31 +459,6 @@ ffmpeg_stream_tag(struct input_stream *is)
if
(
idx
>=
0
)
ffmpeg_copy_metadata
(
tag
,
f
->
streams
[
idx
]
->
metadata
,
ffmpeg_tag_maps
[
i
]);
}
#else
if
(
f
->
author
[
0
])
tag_add_item
(
tag
,
TAG_ARTIST
,
f
->
author
);
if
(
f
->
title
[
0
])
tag_add_item
(
tag
,
TAG_TITLE
,
f
->
title
);
if
(
f
->
album
[
0
])
tag_add_item
(
tag
,
TAG_ALBUM
,
f
->
album
);
if
(
f
->
track
>
0
)
{
char
buffer
[
16
];
snprintf
(
buffer
,
sizeof
(
buffer
),
"%d"
,
f
->
track
);
tag_add_item
(
tag
,
TAG_TRACK
,
buffer
);
}
if
(
f
->
comment
[
0
])
tag_add_item
(
tag
,
TAG_COMMENT
,
f
->
comment
);
if
(
f
->
genre
[
0
])
tag_add_item
(
tag
,
TAG_GENRE
,
f
->
genre
);
if
(
f
->
year
>
0
)
{
char
buffer
[
16
];
snprintf
(
buffer
,
sizeof
(
buffer
),
"%d"
,
f
->
year
);
tag_add_item
(
tag
,
TAG_DATE
,
buffer
);
}
#endif
av_close_input_stream
(
f
);
mpd_ffmpeg_stream_close
(
stream
);
...
...
src/input/ffmpeg_input_plugin.c
View file @
9d91aa23
...
...
@@ -21,13 +21,8 @@
#include "input/ffmpeg_input_plugin.h"
#include "input_plugin.h"
#ifdef OLD_FFMPEG_INCLUDES
#include <avio.h>
#include <avformat.h>
#else
#include <libavformat/avio.h>
#include <libavformat/avformat.h>
#endif
#undef G_LOG_DOMAIN
#define G_LOG_DOMAIN "input_ffmpeg"
...
...
@@ -52,14 +47,12 @@ input_ffmpeg_init(G_GNUC_UNUSED const struct config_param *param,
{
av_register_all
();
#if LIBAVFORMAT_VERSION_MAJOR >= 52
/* disable this plugin if there's no registered protocol */
if
(
av_protocol_next
(
NULL
)
==
NULL
)
{
g_set_error
(
error_r
,
ffmpeg_quark
(),
0
,
"No protocol"
);
return
false
;
}
#endif
return
true
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment