aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-07-11 01:04:04 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-07-11 01:04:04 +0200
commit0089fb79cc11eef199c0c63da472aefbeb9fed2c (patch)
tree94643c5cd2668591b9d2c015ed3c6b97f51ed101
parent20ad2152ddc2606b0869e80ebf0b5154f13c7934 (diff)
downloadffmpeg-0089fb79cc11eef199c0c63da472aefbeb9fed2c.tar.gz
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: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavformat/cdg.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libavformat/cdg.c b/libavformat/cdg.c
index f0c14a6366..baf37d4c6a 100644
--- a/libavformat/cdg.c
+++ b/libavformat/cdg.c
@@ -46,10 +46,11 @@ static int read_header(AVFormatContext *s)
avpriv_set_pts_info(vst, 32, 1, 300);
ret = avio_size(s->pb);
- if (ret < 0)
- return ret;
+ if (ret < 0) {
+ 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;
}