put_guid(pb, &ff_asf_codec_comment1_header);
avio_wl32(pb, s->nb_streams);
for (n = 0; n < s->nb_streams; n++) {
- AVCodec *p;
+ const AVCodecDescriptor *codec_desc;
const char *desc;
- int len;
- uint8_t *buf;
- AVIOContext *dyn_buf;
- enc = s->streams[n]->codec;
- p = avcodec_find_encoder(enc->codec_id);
+ enc = s->streams[n]->codec;
+ codec_desc = avcodec_descriptor_get(enc->codec_id);
if (enc->codec_type == AVMEDIA_TYPE_AUDIO)
avio_wl16(pb, 2);
if (enc->codec_id == AV_CODEC_ID_WMAV2)
desc = "Windows Media Audio V8";
else
- desc = p ? p->name : enc->codec_name;
+ desc = codec_desc ? codec_desc->name : NULL;
- if (avio_open_dyn_buf(&dyn_buf) < 0)
- return AVERROR(ENOMEM);
+ if (desc) {
+ AVIOContext *dyn_buf;
+ uint8_t *buf;
+ int len;
- avio_put_str16le(dyn_buf, desc);
- len = avio_close_dyn_buf(dyn_buf, &buf);
- avio_wl16(pb, len / 2); // "number of characters" = length in bytes / 2
+ if (avio_open_dyn_buf(&dyn_buf) < 0)
+ return AVERROR(ENOMEM);
- avio_write(pb, buf, len);
- av_freep(&buf);
+ avio_put_str16le(dyn_buf, desc);
+ len = avio_close_dyn_buf(dyn_buf, &buf);
+ avio_wl16(pb, len / 2); // "number of characters" = length in bytes / 2
+
+ avio_write(pb, buf, len);
+ av_freep(&buf);
+ } else
+ avio_wl16(pb, 0);
avio_wl16(pb, 0); /* no parameters */
-ret: 0 st: 1 flags:1 dts: 0.000000 pts: 0.000000 pos: 575 size: 208
+ret: 0 st: 1 flags:1 dts: 0.000000 pts: 0.000000 pos: 579 size: 208
ret: 0 st:-1 flags:0 ts:-1.000000
-ret: 0 st: 1 flags:1 dts: 0.470000 pts: 0.470000 pos: 147775 size: 209
+ret: 0 st: 1 flags:1 dts: 0.470000 pts: 0.470000 pos: 147779 size: 209
ret: 0 st:-1 flags:1 ts: 1.894167
-ret: 0 st: 1 flags:1 dts: 0.941000 pts: 0.941000 pos: 301375 size: 209
+ret: 0 st: 1 flags:1 dts: 0.941000 pts: 0.941000 pos: 301379 size: 209
ret: 0 st: 0 flags:0 ts: 0.788000
-ret: 0 st: 1 flags:1 dts: 0.941000 pts: 0.941000 pos: 301375 size: 209
+ret: 0 st: 1 flags:1 dts: 0.941000 pts: 0.941000 pos: 301379 size: 209
ret: 0 st: 0 flags:1 ts:-0.317000
-ret: 0 st: 1 flags:1 dts: 0.000000 pts: 0.000000 pos: 575 size: 208
+ret: 0 st: 1 flags:1 dts: 0.000000 pts: 0.000000 pos: 579 size: 208
ret: 0 st: 1 flags:0 ts: 2.577000
-ret: 0 st: 1 flags:1 dts: 0.993000 pts: 0.993000 pos: 330175 size: 209
+ret: 0 st: 1 flags:1 dts: 0.993000 pts: 0.993000 pos: 330179 size: 209
ret: 0 st: 1 flags:1 ts: 1.471000
-ret: 0 st: 1 flags:1 dts: 0.993000 pts: 0.993000 pos: 330175 size: 209
+ret: 0 st: 1 flags:1 dts: 0.993000 pts: 0.993000 pos: 330179 size: 209
ret: 0 st:-1 flags:0 ts: 0.365002
-ret: 0 st: 1 flags:1 dts: 0.470000 pts: 0.470000 pos: 147775 size: 209
+ret: 0 st: 1 flags:1 dts: 0.470000 pts: 0.470000 pos: 147779 size: 209
ret: 0 st:-1 flags:1 ts:-0.740831
-ret: 0 st: 1 flags:1 dts: 0.000000 pts: 0.000000 pos: 575 size: 208
+ret: 0 st: 1 flags:1 dts: 0.000000 pts: 0.000000 pos: 579 size: 208
ret: 0 st: 0 flags:0 ts: 2.153000
-ret: 0 st: 1 flags:1 dts: 0.941000 pts: 0.941000 pos: 301375 size: 209
+ret: 0 st: 1 flags:1 dts: 0.941000 pts: 0.941000 pos: 301379 size: 209
ret: 0 st: 0 flags:1 ts: 1.048000
-ret: 0 st: 1 flags:1 dts: 0.941000 pts: 0.941000 pos: 301375 size: 209
+ret: 0 st: 1 flags:1 dts: 0.941000 pts: 0.941000 pos: 301379 size: 209
ret: 0 st: 1 flags:0 ts:-0.058000
-ret: 0 st: 1 flags:1 dts: 0.000000 pts: 0.000000 pos: 575 size: 208
+ret: 0 st: 1 flags:1 dts: 0.000000 pts: 0.000000 pos: 579 size: 208
ret: 0 st: 1 flags:1 ts: 2.836000
-ret: 0 st: 1 flags:1 dts: 0.993000 pts: 0.993000 pos: 330175 size: 209
+ret: 0 st: 1 flags:1 dts: 0.993000 pts: 0.993000 pos: 330179 size: 209
ret: 0 st:-1 flags:0 ts: 1.730004
-ret: 0 st: 1 flags:1 dts: 0.941000 pts: 0.941000 pos: 301375 size: 209
+ret: 0 st: 1 flags:1 dts: 0.941000 pts: 0.941000 pos: 301379 size: 209
ret: 0 st:-1 flags:1 ts: 0.624171
-ret: 0 st: 1 flags:1 dts: 0.470000 pts: 0.470000 pos: 147775 size: 209
+ret: 0 st: 1 flags:1 dts: 0.470000 pts: 0.470000 pos: 147779 size: 209
ret: 0 st: 0 flags:0 ts:-0.482000
-ret: 0 st: 1 flags:1 dts: 0.000000 pts: 0.000000 pos: 575 size: 208
+ret: 0 st: 1 flags:1 dts: 0.000000 pts: 0.000000 pos: 579 size: 208
ret: 0 st: 0 flags:1 ts: 2.413000
-ret: 0 st: 1 flags:1 dts: 0.941000 pts: 0.941000 pos: 301375 size: 209
+ret: 0 st: 1 flags:1 dts: 0.941000 pts: 0.941000 pos: 301379 size: 209
ret: 0 st: 1 flags:0 ts: 1.307000
-ret: 0 st: 1 flags:1 dts: 0.993000 pts: 0.993000 pos: 330175 size: 209
+ret: 0 st: 1 flags:1 dts: 0.993000 pts: 0.993000 pos: 330179 size: 209
ret: 0 st: 1 flags:1 ts: 0.201000
-ret: 0 st: 1 flags:1 dts: 0.183000 pts: 0.183000 pos: 70975 size: 209
+ret: 0 st: 1 flags:1 dts: 0.183000 pts: 0.183000 pos: 70979 size: 209
ret: 0 st:-1 flags:0 ts:-0.904994
-ret: 0 st: 1 flags:1 dts: 0.000000 pts: 0.000000 pos: 575 size: 208
+ret: 0 st: 1 flags:1 dts: 0.000000 pts: 0.000000 pos: 579 size: 208
ret: 0 st:-1 flags:1 ts: 1.989173
-ret: 0 st: 1 flags:1 dts: 0.941000 pts: 0.941000 pos: 301375 size: 209
+ret: 0 st: 1 flags:1 dts: 0.941000 pts: 0.941000 pos: 301379 size: 209
ret: 0 st: 0 flags:0 ts: 0.883000
-ret: 0 st: 1 flags:1 dts: 0.941000 pts: 0.941000 pos: 301375 size: 209
+ret: 0 st: 1 flags:1 dts: 0.941000 pts: 0.941000 pos: 301379 size: 209
ret: 0 st: 0 flags:1 ts:-0.222000
-ret: 0 st: 1 flags:1 dts: 0.000000 pts: 0.000000 pos: 575 size: 208
+ret: 0 st: 1 flags:1 dts: 0.000000 pts: 0.000000 pos: 579 size: 208
ret: 0 st: 1 flags:0 ts: 2.672000
-ret: 0 st: 1 flags:1 dts: 0.993000 pts: 0.993000 pos: 330175 size: 209
+ret: 0 st: 1 flags:1 dts: 0.993000 pts: 0.993000 pos: 330179 size: 209
ret: 0 st: 1 flags:1 ts: 1.566000
-ret: 0 st: 1 flags:1 dts: 0.993000 pts: 0.993000 pos: 330175 size: 209
+ret: 0 st: 1 flags:1 dts: 0.993000 pts: 0.993000 pos: 330179 size: 209
ret: 0 st:-1 flags:0 ts: 0.460008
-ret: 0 st: 1 flags:1 dts: 0.470000 pts: 0.470000 pos: 147775 size: 209
+ret: 0 st: 1 flags:1 dts: 0.470000 pts: 0.470000 pos: 147779 size: 209
ret: 0 st:-1 flags:1 ts:-0.645825
-ret: 0 st: 1 flags:1 dts: 0.000000 pts: 0.000000 pos: 575 size: 208
+ret: 0 st: 1 flags:1 dts: 0.000000 pts: 0.000000 pos: 579 size: 208