Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- puts("Doing SHIZ!");
- printf("LIBAV VERSION: %i\n",LIBAVCODEC_VERSION_MAJOR);
- AVCodec* codec = avcodec_find_decoder(file->codec_context->codec_id);
- if (avcodec_open2(file->codec_context, codec, NULL) < 0)
- return NULL;
- AVPacket packet;
- int decoded;
- enum AVSampleFormat sample_format = file->codec_context->sample_fmt;
- AVFrame* frame = avcodec_alloc_frame();
- if(av_read_frame(file->format_context, &packet) != 0)
- return NULL;
- avcodec_decode_audio4(file->codec_context, frame, &decoded, &packet);
- if(decoded != 0)
- {
- puts("Doing SHIZA!");
- if(frame->format != sample_format)
- return NULL;
- }
- else
- {
- puts("Doing SHIZB!");
- return NULL;
- }
- puts("Doing SHIZ2!");
- ///////////////////////
- // Output
- ///////////////////////
- // Doing SHIZ!
- // LIBAV VERSION: 54
- // [flac @ 0x11e3160] invalid sync code
- // [flac @ 0x11e3160] invalid frame header
- // [flac @ 0x11e3160] decode_frame() failed
- // Doing SHIZB!
- ///////////////////////
Advertisement
Add Comment
Please, Sign In to add comment