Opened 4 years ago

Closed 4 years ago

#1100 closed defect (invalid)

nut_read_timestamp@nutdec.c doesn return value for Android NDK

Reported by: obucinac Owned by:
Priority: normal Component: avformat
Version: 0.10 Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no


When building ffmpeg with Android NDK, the toolchain complains that function nut_read_timestamp, located in file libavformt/nutdec.c does not return value.

Function ends like this:

if (stream_index == -1) return pts;
else if(stream_index == -2) return back_ptr;


And my fix is this:

if (stream_index == -1) return pts;
else if(stream_index == -2) return back_ptr;

return 0;

I just need to return anything to enable compilation.

Change History (3)

comment:1 Changed 4 years ago by cehoyos

To make this a valid ticket, please add the following:

  • Please test current git head.
  • The complete, uncut output of your failing make call, preferable "make V=1" after running make several times (do not add the complete, uncut output of the first failing call to make).
  • Please add a unified patch or a patch made with git.

comment:2 Changed 4 years ago by obucinac

Please, note that there is no make in Android NDK, at least it is not called directly in a way most of people used to call it. Android provides its own make file formats, and commands for building libraries and applications.

This is the error from the git-2b07f57 version:

external/ffmpeg-HEAD-2b07f57/libavformat/nutdec.c: In function 'nut_read_timestamp':
external/ffmpeg-HEAD-2b07f57/libavformat/nutdec.c:853: error: control reaches end of non-void function
make: *** [out/target/product/generic/obj/SHARED_LIBRARIES/libavformat-HEAD-2b07f57_intermediates/nutdec.o] Error 1
make: Leaving directory `/scratch/workareas/android'

I wanted to send you library prepared for Android build, but the attachment file size limit is too small.

Last edited 4 years ago by obucinac (previous) (diff)

comment:3 Changed 4 years ago by reimar

  • Resolution set to invalid
  • Status changed from new to closed

While I send a patch to improve that code (yours is no good because it will just lead to a unreachable code warning with better compilers), you are on your own when using third-party build systems.
Standard configure and make work just fine the NDK compiler (if not you can report issues to us), if you insist on using their build system (which I'd consider very badly designed, plus making warnings like this that have loads of false positives since they rely on the optimizer errors is not particularly bright either) then you are on your own.
At least IMHO.

Note: See TracTickets for help on using tickets.