AVPacket *pkt = ret > 0 ? (AVPacket*)ipkt : 0;
if( pkt ) {
if( pkt->stream_index != st->index ) continue;
- if( !pkt->data | !pkt->size ) continue;
+ if( !pkt->data || !pkt->size ) continue;
}
if( (ret=avcodec_send_packet(avctx, pkt)) < 0 ) {
ff_err(ret, "FFStream::decode: avcodec_send_packet failed.\nfile:%s\n",
frame->best_effort_timestamp = AV_NOPTS_VALUE;
int ret = avcodec_receive_frame(avctx, frame);
if( ret < 0 ) {
- if( first_frame || ret == AVERROR(EAGAIN) ) return 0;
+ if( first_frame ) return 0;
+ if( ret == AVERROR(EAGAIN) ) return 0;
if( ret == AVERROR_EOF ) { st_eof(1); return 0; }
ff_err(ret, "FFAudioStream::decode_frame: Could not read audio frame.\nfile:%s\n",
ffmpeg->fmt_ctx->url);
int first_frame = seeked; seeked = 0;
int ret = avcodec_receive_frame(avctx, frame);
if( ret < 0 ) {
- if( first_frame || ret == AVERROR(EAGAIN) ) return 0;
+ if( first_frame ) return 0;
if( ret == AVERROR(EAGAIN) ) return 0;
if( ret == AVERROR_EOF ) { st_eof(1); return 0; }
ff_err(ret, "FFVideoStream::decode_frame: Could not read video frame.\nfile:%s\n,",
vid->height = asset->height;
vid->frame_rate = asset->frame_rate;
- AVPixelFormat pix_fmt = AV_PIX_FMT_NONE;
+ AVPixelFormat pix_fmt = av_get_pix_fmt(asset->ff_pixel_format);
if( opt_hw_dev != 0 ) {
AVHWDeviceType hw_type = vid->encode_hw_activate(opt_hw_dev);
switch( hw_type ) {
pix_fmt = AV_PIX_FMT_VAAPI;
break;
case AV_HWDEVICE_TYPE_NONE:
- default:
- pix_fmt = av_get_pix_fmt(asset->ff_pixel_format);
- break;
+ default: break;
}
}
if( pix_fmt == AV_PIX_FMT_NONE )