Commit 0089fb79 authored by Michael Niedermayer's avatar Michael Niedermayer

avformat/cdg: Do not fail if filesize cannot be determined

This fixes cdg with piped input which was broken by the previous commit
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 20ad2152
...@@ -46,10 +46,11 @@ static int read_header(AVFormatContext *s) ...@@ -46,10 +46,11 @@ static int read_header(AVFormatContext *s)
avpriv_set_pts_info(vst, 32, 1, 300); avpriv_set_pts_info(vst, 32, 1, 300);
ret = avio_size(s->pb); ret = avio_size(s->pb);
if (ret < 0) if (ret < 0) {
return ret; av_log(s, AV_LOG_WARNING, "Cannot calculate duration as file size cannot be determined\n");
} else
vst->duration = (ret * vst->time_base.den) / (CDG_PACKET_SIZE * 300); vst->duration = (ret * vst->time_base.den) / (CDG_PACKET_SIZE * 300);
return 0; return 0;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment