History

Make av_get_channel_layout_string() guess the number of channels if it was not provided.

Originally committed as revision 26324 to svn://svn.ffmpeg.org/ffmpeg/trunk

Stefano Sabatini committed 15 years ago

Commit 8b69c2f1 parent caeb0c33 files · +5 −1Browse files

Unified · Split

3 files
  1. libavcore/audioconvert.c +3 −0
  2. libavcore/audioconvert.h +1 −0
  3. libavcore/avcore.h +1 −1
libavcore/audioconvert.c+3−0
@@ -78,6 +78,9 @@ void av_get_channel_layout_string(char *buf, int buf_size, · 77 unmodified lines
78{78{
79 int i;79 int i;
80 80
81 if (nb_channels <= 0)
82 nb_channels = av_get_channel_layout_nb_channels(channel_layout);
83
81 for (i = 0; channel_layout_map[i].name; i++)84 for (i = 0; channel_layout_map[i].name; i++)
82 if (nb_channels == channel_layout_map[i].nb_channels &&85 if (nb_channels == channel_layout_map[i].nb_channels &&
83 channel_layout == channel_layout_map[i].layout) {86 channel_layout == channel_layout_map[i].layout) {
libavcore/audioconvert.h+1−0
@@ -80,6 +80,7 @@ int64_t av_get_channel_layout(const char *name); · 79 unmodified lines
80 80
81/**81/**
82 * Return a description of a channel layout.82 * Return a description of a channel layout.
83 * If nb_channels is <= 0, it is guessed from the channel_layout.
83 *84 *
84 * @param buf put here the string containing the channel layout85 * @param buf put here the string containing the channel layout
85 * @param buf_size size in bytes of the buffer86 * @param buf_size size in bytes of the buffer
libavcore/avcore.h+1−1
@@ -28,7 +28,7 @@ · 27 unmodified lines
28 28
29#define LIBAVCORE_VERSION_MAJOR 029#define LIBAVCORE_VERSION_MAJOR 0
30#define LIBAVCORE_VERSION_MINOR 1630#define LIBAVCORE_VERSION_MINOR 16
31#define LIBAVCORE_VERSION_MICRO 031#define LIBAVCORE_VERSION_MICRO 1
32 32
33#define LIBAVCORE_VERSION_INT AV_VERSION_INT(LIBAVCORE_VERSION_MAJOR, \33#define LIBAVCORE_VERSION_INT AV_VERSION_INT(LIBAVCORE_VERSION_MAJOR, \
34 LIBAVCORE_VERSION_MINOR, \34 LIBAVCORE_VERSION_MINOR, \

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t