History

Merge commit '4d012eb541ed7f35e00c87035a470d9f0a24a6e8'

* commit '4d012eb541ed7f35e00c87035a470d9f0a24a6e8': xwma: Fix wrong printf format expression. xwma demuxer: typos oggdec: simplify audio chained ogg streams support

Michael Niedermayer committed 15 years ago

Commit d3b379b2 parents f6302ad 4d012eb3 files · +9 −12Browse files

Unified · Split

3 files
  1. libavformat/oggdec.c +1 −7
  2. libavformat/oggdec.h +0 −1
  3. libavformat/xwma.c +8 −4
libavformat/oggdec.c+1−7
@@ -164,7 +164,6 @@ ogg_new_stream (AVFormatContext * s, uint32_t serial) · 163 unmodified lines
164 os->bufsize = DECODER_BUFFER_SIZE;164 os->bufsize = DECODER_BUFFER_SIZE;
165 os->buf = av_malloc(os->bufsize);165 os->buf = av_malloc(os->bufsize);
166 os->header = -1;166 os->header = -1;
167 os->page_begin = 1;
168 167
169 st = av_new_stream (s, idx);168 st = av_new_stream (s, idx);
170 if (!st)169 if (!st)
@@ -242,8 +241,7 @@ ogg_read_page (AVFormatContext * s, int *str) · 71 unmodified lines
242 241
243 idx = ogg_find_stream (ogg, serial);242 idx = ogg_find_stream (ogg, serial);
244 if (idx < 0){243 if (idx < 0){
245 for (i = 0; i < ogg->nstreams; i++) {244 if (ogg->headers) {
246 if (!ogg->streams[i].page_begin) {
247 int n;245 int n;
248 246
249 for (n = 0; n < ogg->nstreams; n++) {247 for (n = 0; n < ogg->nstreams; n++) {
@@ -252,8 +250,6 @@ ogg_read_page (AVFormatContext * s, int *str) · 2 unmodified lines
252 }250 }
253 ogg->curidx = -1;251 ogg->curidx = -1;
254 ogg->nstreams = 0;252 ogg->nstreams = 0;
255 break;
256 }
257 }253 }
258 idx = ogg_new_stream (s, serial);254 idx = ogg_new_stream (s, serial);
259 if (idx < 0)255 if (idx < 0)
@@ -261,8 +257,6 @@ ogg_read_page (AVFormatContext * s, int *str) · 1 unmodified line
261 }257 }
262 258
263 os = ogg->streams + idx;259 os = ogg->streams + idx;
264 if (!(flags & OGG_FLAG_BOS))
265 os->page_begin = 0;
266 os->page_pos = avio_tell(bc) - 27;260 os->page_pos = avio_tell(bc) - 27;
267 261
268 if(os->psize > 0)262 if(os->psize > 0)
libavformat/oggdec.h+0−1
@@ -75,7 +75,6 @@ struct ogg_stream { · 74 unmodified lines
75 int incomplete; ///< whether we're expecting a continuation in the next page75 int incomplete; ///< whether we're expecting a continuation in the next page
76 int page_end; ///< current packet is the last one completed in the page76 int page_end; ///< current packet is the last one completed in the page
77 int keyframe_seek;77 int keyframe_seek;
78 int page_begin; ///< set to 1 if the stream only received a begin-of-stream packet, otherwise 0
79 void *private;78 void *private;
80};79};
81 80
libavformat/xwma.c+8−4
@@ -19,6 +19,8 @@ · 18 unmodified lines
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */20 */
21 21
22#include <inttypes.h>
23
22#include "avformat.h"24#include "avformat.h"
23#include "riff.h"25#include "riff.h"
24 26
@@ -90,7 +92,7 @@ static int xwma_read_header(AVFormatContext *s, AVFormatParameters *ap) · 65 unmodified lines
90 * codecs require extradata, so we provide our own fake extradata.92 * codecs require extradata, so we provide our own fake extradata.
91 *93 *
92 * First, check that there really was no extradata in the header. If94 * First, check that there really was no extradata in the header. If
93 * there was, then try to use, after asking the the user to provide a95 * there was, then try to use it, after asking the user to provide a
94 * sample of this unusual file.96 * sample of this unusual file.
95 */97 */
96 if (st->codec->extradata_size != 0) {98 if (st->codec->extradata_size != 0) {
@@ -129,7 +131,7 @@ static int xwma_read_header(AVFormatContext *s, AVFormatParameters *ap) · 32 unmodified lines
129 /* Quoting the MSDN xWMA docs on the dpds chunk: "Contains the131 /* Quoting the MSDN xWMA docs on the dpds chunk: "Contains the
130 * decoded packet cumulative data size array, each element is the132 * decoded packet cumulative data size array, each element is the
131 * number of bytes accumulated after the corresponding xWMA packet133 * number of bytes accumulated after the corresponding xWMA packet
132 * is decoded in order"134 * is decoded in order."
133 *135 *
134 * Each packet has size equal to st->codec->block_align, which in136 * Each packet has size equal to st->codec->block_align, which in
135 * all cases I saw so far was always 2230. Thus, we can use the137 * all cases I saw so far was always 2230. Thus, we can use the
@@ -144,11 +146,13 @@ static int xwma_read_header(AVFormatContext *s, AVFormatParameters *ap) · 8 unmodified lines
144 146
145 /* Compute the number of entries in the dpds chunk. */147 /* Compute the number of entries in the dpds chunk. */
146 if (size & 3) { /* Size should be divisible by four */148 if (size & 3) { /* Size should be divisible by four */
147 av_log(s, AV_LOG_WARNING, "dpds chunk size "PRId64" not divisible by 4\n", size);149 av_log(s, AV_LOG_WARNING,
150 "dpds chunk size %"PRId64" not divisible by 4\n", size);
148 }151 }
149 dpds_table_size = size / 4;152 dpds_table_size = size / 4;
150 if (dpds_table_size == 0 || dpds_table_size >= INT_MAX / 4) {153 if (dpds_table_size == 0 || dpds_table_size >= INT_MAX / 4) {
151 av_log(s, AV_LOG_ERROR, "dpds chunk size "PRId64" invalid\n", size);154 av_log(s, AV_LOG_ERROR,
155 "dpds chunk size %"PRId64" invalid\n", size);
152 return -1;156 return -1;
153 }157 }
154 158

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