diff options
author | Max Kellermann <max@duempel.org> | 2012-09-25 21:23:13 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2012-09-25 21:26:27 +0200 |
commit | 071aca60be8ddeff508d9331bd78e6aa87d9fc52 (patch) | |
tree | ad36711616bb1c7560bb83e93075ad0747f7bb25 /src/decoder | |
parent | 133e4d5c51428c3e9999e3778a1e4d5786d99d55 (diff) | |
download | mpd-071aca60be8ddeff508d9331bd78e6aa87d9fc52.tar.gz mpd-071aca60be8ddeff508d9331bd78e6aa87d9fc52.tar.xz mpd-071aca60be8ddeff508d9331bd78e6aa87d9fc52.zip |
decoder/vorbis: rename local variables
Diffstat (limited to 'src/decoder')
-rw-r--r-- | src/decoder/vorbis_decoder_plugin.c | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/src/decoder/vorbis_decoder_plugin.c b/src/decoder/vorbis_decoder_plugin.c index 86993047c..ff6e76eb7 100644 --- a/src/decoder/vorbis_decoder_plugin.c +++ b/src/decoder/vorbis_decoder_plugin.c @@ -48,12 +48,11 @@ #undef G_LOG_DOMAIN #define G_LOG_DOMAIN "vorbis" -#define OGG_CHUNK_SIZE 4096 #if G_BYTE_ORDER == G_BIG_ENDIAN -#define OGG_DECODE_USE_BIGENDIAN 1 +#define VORBIS_BIG_ENDIAN true #else -#define OGG_DECODE_USE_BIGENDIAN 0 +#define VORBIS_BIG_ENDIAN false #endif struct vorbis_input_stream { @@ -203,9 +202,9 @@ vorbis_stream_decode(struct decoder *decoder, decoder_initialized(decoder, &audio_format, vis.seekable, total_time); enum decoder_command cmd = decoder_get_command(decoder); - char chunk[OGG_CHUNK_SIZE]; + char buffer[4096]; int prev_section = -1; - long bitRate = 0; + unsigned kbit_rate = 0; do { if (cmd == DECODE_COMMAND_SEEK) { @@ -217,12 +216,12 @@ vorbis_stream_decode(struct decoder *decoder, } int current_section; - long ret = ov_read(&vf, chunk, sizeof(chunk), - OGG_DECODE_USE_BIGENDIAN, 2, 1, - ¤t_section); - if (ret == OV_HOLE) /* bad packet */ - ret = 0; - else if (ret <= 0) + long nbytes = ov_read(&vf, buffer, sizeof(buffer), + VORBIS_BIG_ENDIAN, 2, 1, + ¤t_section); + if (nbytes == OV_HOLE) /* bad packet */ + nbytes = 0; + else if (nbytes <= 0) /* break on EOF or other error */ break; @@ -253,11 +252,11 @@ vorbis_stream_decode(struct decoder *decoder, long test = ov_bitrate_instant(&vf); if (test > 0) - bitRate = test / 1000; + kbit_rate = test / 1000; cmd = decoder_data(decoder, input_stream, - chunk, ret, - bitRate); + buffer, nbytes, + kbit_rate); } while (cmd != DECODE_COMMAND_STOP); ov_clear(&vf); |