Skip to content

Commit 9bc7586

Browse files
committed
Add some missing codec ids.
1 parent e5ab161 commit 9bc7586

File tree

1 file changed

+22
-8
lines changed

1 file changed

+22
-8
lines changed

codec.c

+22-8
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ VideoDecoder *CodecVideoNewDecoder(VideoHwDecoder * hw_decoder)
140140
VideoDecoder *decoder;
141141

142142
if (!(decoder = calloc(1, sizeof(*decoder)))) {
143-
Fatal("codec: can't allocate vodeo decoder");
143+
Fatal("codec: can't allocate vídeo decoder");
144144
}
145145

146146
av_register_all();
@@ -199,7 +199,7 @@ void CodecVideoOpen(VideoDecoder * decoder)
199199
codec_id = AV_CODEC_ID_MPEG2VIDEO;
200200
break;
201201

202-
case 0x1b: /* FALLTHRU */
202+
case 0x1B: /* FALLTHRU */
203203
case 0x20:
204204
codec_id = AV_CODEC_ID_H264;
205205
break;
@@ -209,7 +209,7 @@ void CodecVideoOpen(VideoDecoder * decoder)
209209
break;
210210

211211
default:
212-
Fatal("codec: unknown vtype: 0x%x", device_get_vtype());
212+
Error("codec: unknown vtype: 0x%x", device_get_vtype());
213213
break;
214214
}
215215

@@ -250,15 +250,15 @@ void CodecVideoOpen(VideoDecoder * decoder)
250250

251251
ret = avformat_find_stream_info(decoder->VideoFmtCtx, NULL);
252252
if (ret < 0) {
253-
Error("codec: can't find stream info: %s", av_err2str(ret));
253+
Error("codec: can't find video stream info: %s", av_err2str(ret));
254254
goto error_avformat_find_stream_info;
255255
}
256256

257257
av_dump_format(decoder->VideoFmtCtx, 0, "vaapidevice video", 0);
258258

259259
ret = av_find_best_stream(decoder->VideoFmtCtx, AVMEDIA_TYPE_VIDEO, -1, -1, &video_codec, 0);
260260
if (ret < 0) {
261-
Error("codec: can't find best stream: %s", av_err2str(ret));
261+
Error("codec: can't find best video stream: %s", av_err2str(ret));
262262
goto error_avformat_find_best_stream;
263263
}
264264
decoder->VideoCodec = video_codec;
@@ -564,18 +564,32 @@ void CodecAudioOpen(AudioDecoder * audio_decoder, int codec_id_old)
564564
pthread_mutex_lock(&CodecLockMutex);
565565

566566
switch (device_get_atype()) {
567+
case -1:
568+
goto error_avformat_alloc_context;
569+
break;
567570
case 0:
568571
break;
569572
case 0x3: /* FALLTHRU */
570573
case 0x4:
571574
codec_id = AV_CODEC_ID_MP2;
572575
break;
573-
574-
case 0x6a:
576+
case 0x6A:
575577
codec_id = AV_CODEC_ID_AC3;
576578
break;
579+
case 0x6:
580+
case 0x7A:
581+
codec_id = AV_CODEC_ID_EAC3;
582+
break;
583+
case 0x7B:
584+
codec_id = AV_CODEC_ID_DTS;
585+
break;
586+
case 0xF:
587+
case 0x11:
588+
case 0x7C:
589+
codec_id = AV_CODEC_ID_AAC;
590+
break;
577591
default:
578-
Fatal("Unknown atype: 0x%x", device_get_atype());
592+
Error("Unknown atype: 0x%x", device_get_atype());
579593
break;
580594
}
581595

0 commit comments

Comments
 (0)