[mythtv] [BUG?] mythmusic seeking in WMA files

Andy McMullan andymcm at gmail.com
Fri Jan 21 16:49:17 EST 2005


> Haven't investigated as I don't have much WMA stuff.

Ok, decided to take a quick look at this. Haven't determined the
underlying cause, but I've got a quick hack for anyone who needs it.
This problem code path seems to be in libavformat/utils.c, in the
av_find_stream_info() function:

        ret = av_read_frame_internal(ic, &pkt1);
        if (ret < 0) {
            /* EOF or error */
            ret = -1; /* we could not have all the codec parameters
before EOF */
            if ((ic->ctx_flags & AVFMTCTX_NOHEADER) &&
                i == ic->nb_streams)
                ret = 0;
            break;
        }

av_read_frame_internal returns an error (-2 IIRC), ret is set to -1,
the if( ic->ctx_flags ... ) clause isn't true, so ret stays as -1 and
gets propagated back to avfDecoder::initialise, which then fails.

The hack is to comment out the if clause, meaning ret gets set to 0.
In other words, pretend we didn't get an error. With this hack, WMA
playback works fine.

Obviously this isn't a fix - maybe someone who knows the code will
easily spot what's wrong here. My guess is that we're hitting an EOF
condition, but interpreting it as an error rather than a EOF. Maybe in
an earlier version of this code, the if( ic->ctx_flags ... )
expression evaluated to true, but now it doesn't. FYI the values of
the components of the expression are:

ic->ctx_flags = 0
i = 0
ic->nb_streams = 1

Hope that helps somebody.

Andy


More information about the mythtv-dev mailing list