diff options
Diffstat (limited to 'lib/rbcodec/codecs/libm4a')
-rw-r--r-- | lib/rbcodec/codecs/libm4a/m4a.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/rbcodec/codecs/libm4a/m4a.c b/lib/rbcodec/codecs/libm4a/m4a.c index 17af4cfece..958d0b1575 100644 --- a/lib/rbcodec/codecs/libm4a/m4a.c +++ b/lib/rbcodec/codecs/libm4a/m4a.c | |||
@@ -122,16 +122,19 @@ void stream_create(stream_t *stream,struct codec_api* ci) | |||
122 | int m4a_check_sample_offset(demux_res_t *demux_res, uint32_t frame, uint32_t *start) | 122 | int m4a_check_sample_offset(demux_res_t *demux_res, uint32_t frame, uint32_t *start) |
123 | { | 123 | { |
124 | uint32_t i = *start; | 124 | uint32_t i = *start; |
125 | for (i=0; i<demux_res->num_lookup_table; ++i) | 125 | for (;i < demux_res->num_lookup_table; ++i) |
126 | { | 126 | { |
127 | if (demux_res->lookup_table[i].sample > frame || | 127 | if (demux_res->lookup_table[i].sample > frame) |
128 | demux_res->lookup_table[i].offset == 0) | ||
129 | return -1; | ||
130 | if (demux_res->lookup_table[i].sample == frame) | ||
131 | break; | 128 | break; |
129 | |||
130 | if (demux_res->lookup_table[i].sample == frame) | ||
131 | { | ||
132 | *start = i; | ||
133 | return demux_res->lookup_table[i].offset; | ||
134 | } | ||
132 | } | 135 | } |
133 | *start = i; | 136 | *start = i; |
134 | return demux_res->lookup_table[i].offset; | 137 | return -1; |
135 | } | 138 | } |
136 | 139 | ||
137 | /* Seek to desired sound sample location. Return 1 on success (and modify | 140 | /* Seek to desired sound sample location. Return 1 on success (and modify |