Mplayer patch: make mplayer work with growing files

Mplayer currently doesn't seem to handle the growing files. They are usually used when you stream something from the web (e.g. youtube-dl). Now when mplayer reaches the offset which was the size at the open time it just quits with various errors. Here's a simple way to reproduce. Get/download a movie and do the following (let's name our movie b.mp4):
$ size=$((2*1024*1024))
$ head -c $size b.mp4 > a.mp4
Now start mplayer a.mp4. Tweak the size parameter to have around ~10 seconds of movie. Mplayer will quit when it reaches the 10th second. Now do this:
$ head -c $size b.mp4 > a.mp4
$ [start the movie in the background and wait until it begins to play]
$ tail -c +$((size+1)) b.mp4 >> a.mp4
Mplayer will still quit at the 10th second even though it could continue playing (VLC continues to play without a hitch).
Mplayer used to continue playing but it was because ffmpeg was buggy and stopped working after the following patch has been introduced: http://patches.libav.org/patch/14105/
I'm not sure how to fix this properly but this patch seems to fix this on my computer. There's a related bug to this and this patch seems to fix that too: http://bugzilla.mplayerhq.hu/show_bug.cgi?id=1821
I've sent this patch upstream, but I got no response, so I thought I post it here in case anybody else wants to try it (or try to send it upstream again):
Index: stream/cache2.c
===================================================================
--- stream/cache2.c (revision 34788)
+++ stream/cache2.c (working copy)
@@ -579,6 +579,15 @@
return (cv->max_filepos-cv->read_filepos)/(cv->buffer_size / 100);
+off_t cache_maxpos(stream_t *s)
+{
+ cache_vars_t *cv;
+ if (!s || !s->cache_data)
+ return -1;
+ cv = s->cache_data;
+ return cv->max_filepos - 1;
+}
+
int cache_stream_seek_long(stream_t *stream,off_t pos){
cache_vars_t* s;
off_t newpos;
Index: stream/cache2.h
===================================================================
--- stream/cache2.h (revision 34788)
+++ stream/cache2.h (working copy)
@@ -24,5 +24,7 @@
void cache_uninit(stream_t *s);
int cache_do_control(stream_t *stream, int cmd, void *arg);
int cache_fill_status(stream_t *s);
+/// Return the offset of the last byte in the cache.
+off_t cache_maxpos(stream_t *s);
#endif /* MPLAYER_CACHE2_H */
Index: libmpdemux/demux_lavf.c
===================================================================
--- libmpdemux/demux_lavf.c (revision 34788)
+++ libmpdemux/demux_lavf.c (working copy)
@@ -99,6 +99,8 @@
stream_t *stream = demuxer->stream;
int64_t current_pos;
mp_msg(MSGT_HEADER,MSGL_DBG2,"mp_seek(%p, %"PRId64", %d)\n", stream, pos, whence);
+ off_t maxpos = stream->end_pos = cache_maxpos(stream);
+ if (maxpos+1 > stream->end_pos) stream->end_pos = maxpos+1;
if(whence == SEEK_CUR)
pos +=stream_tell(stream);
else if(whence == SEEK_END && stream->end_pos > 0)

Thank you for this. I've been experiencing this problem and I find it very disruptive to my normal work-flow. For now, I've downgraded to mplayer version 34426-3, since I don't want to compile the whole of mplayer. Hopefully upstream can get this issue sorted out.

Similar Messages

  • Has anyone not working with .dv files had synchronization problems?

    Has anyone not working with .dv files had sound synchronization problems? I'm not exactly sure what the alternatives to DV are, but I think one of them is HD.
    The reason for asking this question is to help isolate the nature and cause of a very serious flaw in iMovie '11. In the original release of iMovie '11 (version 9.0) there was a small--but serious--synchronization problem. In the 9.01 there is a large synchronization problem. We know of one person who has not experienced the problem, and he is not working with DV files (media). So we want to find out if anyone who is using something other than .dv files is experiencing a lack of synchronization between sound and picture. Knowing the answer to this will help with figuring out where the cause lies. For the initial iMovie '11 release (9.0), you probably would not notice a problem unless you had very long event-clips, e.g., two hours long. Events get this long if you are transferring from analog 8 mm tapes. Even then, it would have to be in scenes in which the connection between event and sound is obvious, e.g., close ups of people talking. It isn't until the 9.01 release that most people would notice anything. All we need to do is establish one case of a synchronization problem in which the person is using something other than DV.
    Message was edited by: Paul Bullen

    Hopefully, the 9.0.2 release will make my question moot. Zyfert must have posted the announcement of the release just as I was formulating my question. Still, if you have information on the subject, it would be interesting to hear.

  • Very slow responce when working with Office file on DFS-Share

    Very slow responce when working with Office file on DFS-Share
    We have implemented the following configuration
    Domain level Windows 2000. Two member servers with Windows Server 2008 R2, sharing the same DFS namespace with, at the moment, one folder target called Home.
    Users complaining that the access to different MS Office files is very slow. Even creating a new MS Word document using right click context menu takes up to 4 minutes to open. Saving, for example, one singe Excel sheet takes also few minutes.
    Tested with both, MS Office 2007 and MS Office 2010. Makes no difference. When using Office 2010 you can see the message like contacting:
    \\DomainName\Root\Home\UserName. Other files like TXT, JPG or PDF are not affected.
     What makes the thing really weird is the fact, that the behavior described above can absolutely change after client machine being rebooted, suddenly everything becomes very fast and this condition can revert back again just after the next
    reboot.
    Considerations until now:
    1. This has nothing to do with the file size. Even tiny files are affected.
    2. AD Sites are configured correctly and the client workstations see themselves in the correct sites.
    3. This is not an Office issue. If I map my folder target not as DFS, but directly as shared network drive
    \\ServerName\Root\Home\UserName , everything functions as expected
    What makes me suspicious: when using f.e. TCPView to monitor connections, I can see, that each time I make any operation on an office file, there will be a connection established to one of the domain controllers, sometimes to remote ones,
    located in other countries. But on the other side, even if the connection is established to the nearest DC, operations are still very very slow!
    Just forget to say. All clients are Windows 7
    Thanks to all who respond.

    Dear all,
    sorry for the delayed reply. The problem has been solved now and since September 19<sup>th</sup>. everything is functioning as expected.
    What was done:
    Deleted replication targets excepting the initial ones
    Carefully recreated folder targets
    Deleted and recreated  replication groups
    Disabled SNP features on both namespace servers
    Created EnableTCPA registry entry
    Checked that the following Updates are installed
    http://support.microsoft.com/kb/2688074
    http://support.microsoft.com/kb/2647452
    Concering Office File validation KB2553065 - This Update was already declined on our WSUS server
    Kind Regards
    Eduard

  • Working with RAW files in iPhoto 5.0.4 and Elements 4.0.1

    I take photos in RAW mode and download them to iPhoto. When I try to edit the photo in iPhoto, the picture is a tiny little file that is impossible to enlarge with any sort of clarity. Also, the word "RAW" does not appear anywhere on the iPhoto window like I read it is supposed to.
    When I drag the file to Photoshop Elements, I get an editing window that has none of the tools usually associated with JPEG files. I get a separate window in which I can darken or lighten the image, that's it.
    Clearly, I'm doing something wrong. No one in their right mind would ever use RAW if this is how it works.
    Any ideas?

    Hi Jack!
    If you're new working with RAW files, your right, it just doesn't make sense. RAW <imho> is a bit overrated. One thing you will need to keep in mind when shooting in RAW, is you will still need to take a well exposed image. What RAW files will allow are CHANGES in all areas of the image v. JPEG which may allow you to ADJUST a few settings in the image. My only suggestion would be to kepp playing around with PSE until you get the hang of it, it is an excellent image editing software. But realize, a well exposed JPEG and RAW file are hard to tell apart...
    Personally, I do not directly download RAW files through iPhoto but will create a folder and download to here, and simply drage folder to iPhoto to import (which are then 'converted' into JPEG files). This way I have the original RAW images safely located outside of iPhoto as well as in iPhoto. You should set Elements as your choice of application to edit files inside iPhoto.
    Good luck, Rick
    Good link: http://www.elementsvillage.com/forums/ and just for fun: http://www.photoshopcosmetics.com/index.php

  • Unexpected problem: uncaught exception when working with audio files in Soundtrack Pro

    Hey,
    Whenever I double click an audio file in the timeline to work on it, I end up getting the Error message: "Unexpected problem: uncaught exception" and Soundtrack Pro eventually crashes.  Also, this happens when I try to work with audio files in the file editor.  I have Leopard and am using Logic Studio 8.  Any insight would be much appreciated. Thanks
    Matt

    Didnt know how to remove the original clip from the STP arrange window - or whatever it's called in STPro.  So I could go no further in my perverse science experiment. 
    It also appeared that I could only import an aif but not a wav? 
    I gave up on STPro and did what I needed to do in Logic, which I use regularly.    
    Thank you for folowing up on this. 
    PS.  I used to use an old PowerPC version (1.0.3) of STPro and loved the way it visually showed the change in the waveform when you added each efffect.  It appears that the new version (3.0.1) does not allow you to do this anymore?  You can render or flatten the effects to see the final waveform, but then you are dead in the water and cant make changes?  
    Im such a newbie at STPro that I am probably not using it right? 

  • Help: Working with .MOV files in FCP and forced to RENDER FOR EVERY EDIT

    I'm working with .MOV files from my digital camera in Final Cut Pro and every time I make a new edit, I have to render it in order to see it in the canvas.
    How do I make it so that I don't have to render every edit in order to see it?
    (I've worked with files straight from a DV camera, and editing went fine. I'm assuming it has to do with the .MOV files)

    DV Cameras are not the same thing as a Digital camera. Digital cameras offer video on a limited basis and it's usually highly compressed in a non-editing format such as MPEG-2 or similar. NLEs are made to work with video cameras, not still cameras which is why you're having trouble.
    That's not to say you can't edit video captured with a digital camera, but you need to know how to prep it for editing. Some digital cameras shoot at odd frame rates and they all use some form of compression that is not typically used in editing. This means that you'll likely need to convert your clips to an editable format first using Compressor.
    Andy

  • Working with video files on compatible external drive with imovie09

    I have run out of room on my MacBook Pro hard drive, so I have moved all of my video files onto a compatible external hard drive. How do I work with these file in imovie09, do I need to import the files back onto the computer or can I work with them from the external hard drive, if so how. Also, is it possible to after completing editing to save just the project on the computer rather than the hard drive or will that cause a "source video" issue.
    Ultimately, I would like to have all of the source video saved on the external hard drive and the projects saved on the computer
    I had no problems working and saving the files when just using the computer, the external hard drive has complicated things for me. Thanks.

    John Pichola wrote:
    I have run out of room on my MacBook Pro hard drive, so I have moved all of my video files onto a compatible external hard drive. How do I work with these file in imovie09, do I need to import the files back onto the computer or can I work with them from the external hard drive, if so how. Also, is it possible to after completing editing to save just the project on the computer rather than the hard drive or will that cause a "source video" issue.
    How did you move all of your video files? The best way in iMovie '09 is to do it in the Event Library. Make sure you're viewing hard drives (click the disk icon at the upper-right corner of the list of events). Then drag the events you want from your internal hard disk to the external one. That way iMovie keeps track of where the source files are located.
    You can do the same with project files in the Project Library, too.
    If you've already moved the files in the Finder, to do it cleanly, I'd recommend moving them back to the iMovie Projects and iMovie Events folders in your Movies folder. Then launch iMovie and move them as explained above.
    Or, make sure the iMovie Projects and iMovie Events folders are at the top level of your external hard drive. When you launch iMovie, it looks in those places for footage and projects, and will make them available.

  • Photoshop CS6 keeps freezing when I work with large files

    I've had problems with Photoshop CS6 freezing on me and giving me RAM and Scratch Disk alerts/warnings ever since I upgraded to Windows 8.  This usually only happens when I work with large files, however once I work with a large file, I can't seem to work with any file at all that day.  Today however I have received my first error in which Photoshop says that it has stopped working.  I thought that if I post this event info about the error, it might be of some help to someone to try to help me.  The log info is as follows:
    General info
    Faulting application name: Photoshop.exe, version: 13.1.2.0, time stamp: 0x50e86403
    Faulting module name: KERNELBASE.dll, version: 6.2.9200.16451, time stamp: 0x50988950
    Exception code: 0xe06d7363
    Fault offset: 0x00014b32
    Faulting process id: 0x1834
    Faulting application start time: 0x01ce6664ee6acc59
    Faulting application path: C:\Program Files (x86)\Adobe\Adobe Photoshop CS6\Photoshop.exe
    Faulting module path: C:\Windows\SYSTEM32\KERNELBASE.dll
    Report Id: 2e5de768-d259-11e2-be86-742f68828cd0
    Faulting package full name:
    Faulting package-relative application ID:
    I really hope to hear from someone soon, my job requires me to work with Photoshop every day and I run into errors and bugs almost constantly and all of the help I've received so far from people in my office doesn't seem to make much difference at all.  I'll be checking in regularly, so if you need any further details or need me to elaborate on anything, I should be able to get back to you fairly quickly.
    Thank you.

    Here you go Conroy.  These are probably a mess after various attempts at getting help.

  • How to make this work with Firefox, HELP!

    Downloading for Real-player, after watching the full movie, I click download and it has to reread the movie from the internet. When using explorer, after downloading the movie, it reads it from memory, which makes it a fast download. How to make this work with Firefox, I like not to use Microsoft products, and I really like Firefox 7.0.1!!!! HELP!

    -> click '''Firefox''' button and click '''Options''' (OR File Menu -> Options)
    * Advanced panel -> Network tab
    * place Checkmark on '''Override Automatic Cache Management''' -> under '''Limit Cache''' specify a large size of space
    * Remove Checkmark from '''Tell me when websites asks to store data for offline use'''
    * click OK on Options window
    * Restart Firefox
    Check and tell if ts working.

  • How to make this work with Firefox, I like not to use microsoft products! HELP!

    Downloading for Realplayer, after watching the full movie, I click download and it has to reread the movie from the internet. When using explorer, after downloading the movie, it reads it from memory, which makes it a fast download. Hoow to make this work with Firefox, I like not to use microsoft products, and I really like Firefox 7.0.1!!!! HELP!

    -> click '''Firefox''' button and click '''Options''' (OR File Menu -> Options)
    * Advanced panel -> Network tab
    * place Checkmark on '''Override Automatic Cache Management''' -> under '''Limit Cache''' specify a large size of space
    * Remove Checkmark from '''Tell me when websites asks to store data for offline use'''
    * click OK on Options window
    * Restart Firefox
    Check and tell if ts working.

  • Does compressor work with MKV file containers

    Hey
    Does compressor work with MKV file containers? Reason i ask is, i typically make a single Mkv file (Movie.mkv) of my Blu Ray movies. Depending on the length of the movie, it can be 14 to 25 GB. I would like to comporess it further to get a good balance of quality and file size. I currently use handbrake to do it and get it down to 10GB with no noticeable difference in video quality. I was wondering if i can use compressor on my mac pro to do it faster and probably better than handbrake.
    Rpk

    What I do is open the .mkv in quicktime the do a Save As and choose Save As a reference movie. Then I take the reference file into Compressor and compress it to what I want.

  • I accidentally cut instead of copied a folder of previously imported raw files. When I pasted the folder back I could see it in Windows Explore but not in the LR library. How can I work with these files again?

    HI,
    My daughter will often ask me to give her raw files I've taken at family events so that she can process them in her own copy of LR. (I work too slowly, apparently.) Recently I inadvertently cut instead of copied a folder. When I pasted it back I could see it in Windows Explorer but not in my LR library. I thought that re-importing the files might work, LR gave me a message that they were already imported. I expect there is a way to make the files available again in LR and would be grateful for some advice.
    thanks
    Ken

    The solutions is either of the following:
    Adobe Lightroom - Find moved or missing files and folders
    Copy the photos back into the exact same folder and folder location that they were in before
    I don't know what you actually did "when I pasted it back" ... but the bigger issue is that you shouldn't be working with these files in your operating system, period. Once you import them into Lightroom, you don't manage these files in your operating system.

  • Working with RAW files in PSE9:  Doable or better to use PSE12?

    I have PSE 9 and will soon get a camera with RAW capability.  I notice that Adobe no longer supports PSE 9.  Am I in for trouble if I don't upgrade to PSE 12 since I don't know how to work with RAW files?  It sounds as if I will need something to convert RAW files?  Where do I get it?  Is it a big deal for a beginner with no software skills?

    You can download a free DNG Converter from Adobe and then convert your RAWs to DNGs which can be used in PSE9.
    You don't need PSE12, but if you want to purchase PSE 12, you get the most current features in the Raw processor (which in my opinion is a huge improvement over what is available in PSE9), and you don't need the extra step of converting to DNG.

  • Working with Large files in Photoshop 10

    I am taking pictures with a 4X5 large format film camera and scanning them at 3,000 DPI, which is creating extremely large files. My goal is to take them into Photoshop Elements 10 to cleanup, edit, merge photos together and so on. The cleanup tools don't seem to work that well on large files. My end result is to be able to send these pictures out to be printed at large sizes up to 40X60. How can I work in this environment and get the best print results?

    You will need to work with 8bit files to get the benefit of all the editing tools in Elements.
    I would suggest resizing at resolution of 300ppi although you can use much lower resolutions for really large prints that will be viewed from a distance e.g. hung on a gallery wall.
    That should give you an image size of 12,000 x 18,000 pixels if the original aspect ratio is 2:3
    Use the top menu:
    Image >> Resize >> Image Size

  • Working with Multiple Files in Workspace Layout

    If I was working with multiple files in the workspace layout, they each used to be available for selection from a tab.  Now I can either cascade the files horizontally or vertically - but not have them appear in a tab across the top of the workspace layout.
    Does anyone know how to set the workspace to present multiple files in tabs?  I have CS3.

    Tanya,
    This may not help, but the times when that happens to me is when I go too fast and some operations haven't finished. I then try to select a file that hasn't completed and the file I select is in the process of having the data updated. The worst is when it is trying to render as I am doing something.
    I hope this helps some.
    Mel

Maybe you are looking for

  • Issues after upgrading to 10.2.0.4  ( both OMS and Agent)

    All, we are observing this error quite a lot after upgrading to 10.2.0.4 ( both oms and agent) 2008-07-31 15:08:19,088 Thread-228 ERROR : (nmevrr.c,328):Memory 0x0 encountered, expect struct_id=12201 /u1/app/oracle/product/10.2.0/agent10g/lib32/libnm

  • Problem with Quick Edit in PSE 10

    How do I stop Community Help popping up when clicking on Auto Smart Fix in Adobe Photoshop Elements 10?

  • Custom Process Code - IDOCS

    Hi Guys!    This Question is similar to my previous post i want to know whats the reason, when we go for custom process code development for standard idocs & message types, any way sap has provided that.   Is there any nessacary to devlop that, any w

  • Installing flash player in Mac Book Pro

    I been trying to download unsuccessfully the late version of the Adobe Flash Player, but the software get stuck on 27% download. I'm running OS X 10.10.2 in a MacBook Pro i5 with 16Gb of memory. Please advise a solution. Thank you in advance [email p

  • MacBook Pro Video Update 1.0 problem

    I downloaded MacBook Pro Video Update 1.0 (Snow Leopard) and I am using Mac OS X Ver 10.6.8 however it alerts that this software is not supported on your system. I have the problem of black screen of death.  I am using an extra display. I arranged mi